[关闭]
@czyczk 2018-09-05T15:21:27.000000Z 字数 2222 阅读 774

How to Successfully Build a foobar2000 Component

foobar2000



1. Prerequisites

  1. Visual Studio with necessary components
    • Desktop Development with C++ (in Workloads)
    • VC++ (latest version is OK)
    • Windows Universal CRT SDK
    • Visual C++ ATL for x86 and x64
    • Visual C++ MFC for x86 and x64
    • Windows x SDK (latest version is OK)
  2. foobar2000 SDK
  3. Basic C++ programming knowledge (or learn by the sample components off now)

2. Possible Problems

Take the official sample component as example.
foo_sample can be built without modification of code, but you may encounter the following errors during your first attempts:

1. Target version setting to XP which is not installed.
Right click on the first project -> Properties -> Configuration Properties -> General.
Set Windows SDK Version to your available version and Platform Toolset to your available toolset.
Do it for every project in the solution.

2. Cannot open atlapp.h or atlbase.h etc.
It's part of WTL. Download WTL libraries from https://sourceforge.net/projects/wtl/ and append the include files in the VC++ extra input directories (Properties -> VC++ Directories -> Include Directories).

3. Cannot open afxres.h etc.
It's part of MFC (Microsoft Foundation Classes). Use Visual Studio Installer to install the MFC components (it takes only 1 additional component).
https://community.developers.thomsonreuters.com/questions/8225/fatal-error-rc1015-cannot-open-include-file-afxres.html

4. ***.pch not found / cannot open ***.pch
The sample component (or your own component created commonly) uses precompiled headers. Don't try to avoid using them. Just modify /Yu to /Yc (in Properties -> C/C++ -> Precompiled Headers).

5. Linking errors (symbol not defined).
Make sure that your target project has references of its dependent projects (the projects provided by the foobar2000 SDK). Check the project in Solution Explorer (on the left), see the References part. Add in the projects that it needs.
If your starting project uses precompiled headers, don't try to avoid using them by changing related settings in Properties. If you do so, you may encounter linking errors.

6. DWORD, WINAPI undefined or abort_callback is not a type name (+ likely linking errors)
Seems like the files in project foobar2000_sdk_helpers cannot be compiled successfully. Try to link the target project with shared.lib directly to avoid compiling the dependent projects again.
Properties -> Configuration Properties -> Linker -> Input. Add the file shared.lib in folder shared into Additional Dependencies.

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注