HydrogenAudio

Hosted Forums => foobar2000 => Development - (fb2k) => Topic started by: $char(9836) on 2010-05-11 17:55:53

Title: Can't link against the sdk properly in VS2010
Post by: $char(9836) on 2010-05-11 17:55:53
Hi!

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?

Thanks!
Title: Can't link against the sdk properly in VS2010
Post by: Zao on 2010-05-11 18:42:36
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.
(http://www.acc.umu.se/~zao/foo_wave_seekbar-Property-Pages.png)
Title: Can't link against the sdk properly in VS2010
Post by: $char(9836) on 2010-05-11 19:02:31
Many thanks!