Skip to main content


Please be aware that much of the software linked to or mentioned on this forum is niche and therefore infrequently downloaded. Lots of anti-virus scanners and so-called malware detectors like to flag infrequently downloaded software as bad until it is either downloaded enough times, or its developer actually bothers with getting each individual release allow listed by every single AV vendor. You can do many people a great favor when encountering such a "problem" example by submitting them to your AV vendor for examination. For almost everything on this forum, it is a false positive.
Topic: Can't link against the sdk properly in VS2010 (Read 4087 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Can't link against the sdk properly in VS2010


I recently installed Visual Studio 2010 on my system. Most stuff works like in VS2008, however I cannot seem to get a sample plugin to compile correctly!

Here's my steps.

Created a new empty win32 dll project.

Added a file that used DECLARE_COMPONENT_VERSION

Copied the contents of the fb2k sdk to the solution dir.

Added include path to foobar2000\SDK

Added lib include to foobar2000\shared and added shared.lib to linker input

Added pfc, component_client and SDK project to the solution (all the project was created to new format without errors).

Added the above three projects as dependencies to my component project.

Hit Build.

All the project builds just fine, but when it's time for linking I get presented with:
Code: [Select]
4>error LNK2019: unresolved external symbol "void __cdecl pfc::myassert(wchar_t const *,wchar_t const *,unsigned int)" (?myassert@pfc@@YAXPB_W0I@Z) referenced in function "protected: __thiscall service_factory_base::~service_factory_base(void)" (??1service_factory_base@@IAE@XZ)
4> error LNK2019: unresolved external symbol "bool __cdecl core_api::are_services_available(void)" (?are_services_available@core_api@@YA_NXZ) referenced in function "protected: __thiscall service_factory_base::~service_factory_base(void)" (??1service_factory_base@@IAE@XZ)
4>error LNK2001: unresolved external symbol "public: static struct _GUID const componentversion::class_guid" (?class_guid@componentversion@@2U_GUID@@B)
4>error LNK2019: unresolved external symbol "char const * __cdecl core_api::get_my_file_name(void)" (?get_my_file_name@core_api@@YAPBDXZ) referenced in function "public: virtual void __thiscall `anonymous namespace'::componentversion_myimpl::get_file_name(class pfc::string_base &)" (?get_file_name@componentversion_myimpl@?A0xc89fa1f9@@UAEXAAVstring_base@pfc@@@Z)
4>error LNK2001: unresolved external symbol "public: static class service_factory_base * service_factory_base::__internal__list" (?__internal__list@service_factory_base@@2PAV1@A)

I actually managed to solve all of these by manually adding hard coded #pragma comment(lib,"entire path to pfc.lib and the other libs") lines, but this doesn't seem like a real solution!

What do I need to do so the solution links without any fuzz?

I just like listening to music

Can't link against the sdk properly in VS2010

Reply #1
In 2010, project dependencies are not automatically linked to your project.
If you want to link a dependency, add a reference to it in »Common Properties -> Frameworks and References« and set »Link Library Dependencies« to true.
Zao shang yong zao nong zao rang zao ren zao.
To, early in the morning, use a chisel to build a bathtub makes impatient people hot-tempered.

Can't link against the sdk properly in VS2010

Reply #2
Many thanks!
I just like listening to music

SimplePortal 1.0.0 RC1 © 2008-2021