C++ visual studio foobar2000组件生成错误

C++ visual studio foobar2000组件生成错误,c++,visual-studio,sdk,C++,Visual Studio,Sdk,我一直在学习foobar2000组件的开发教程,但只使用很少的代码就不断出现构建错误。我的VS解决方案包括来自foobar2000 SDK的以下项目:foobar2000_组件_客户端、foobar200_SDK和pfc foo_playlists_tag.cpp: #include "U:\SDK\Foobar2000-music-player\foobar2000\SDK\foobar2000.h" DECLARE_COMPONENT_VERSION("Playlists tagger","

我一直在学习foobar2000组件的开发教程,但只使用很少的代码就不断出现构建错误。我的VS解决方案包括来自foobar2000 SDK的以下项目:foobar2000_组件_客户端、foobar200_SDK和pfc

foo_playlists_tag.cpp:

#include "U:\SDK\Foobar2000-music-player\foobar2000\SDK\foobar2000.h"
DECLARE_COMPONENT_VERSION("Playlists tagger","0.0.1","About text here");
VALIDATE_COMPONENT_FILENAME("foo_playlists_tag.dll");
生成输出:

1>------ Build started: Project: foo_playlists_tag, Configuration: Debug x64 ------
1>  foo_playlists_tag.cpp
1>u:\sdk\foobar2000-music-player\foobar2000\shared\fb2kdebug.h(80): warning C4838: conversion from 'int' to 'const ULONG_PTR' requires a narrowing conversion
1>foo_playlists_tag.obj : error LNK2019: unresolved external symbol "void __cdecl pfc::myassert_win32(wchar_t const *,wchar_t const *,unsigned int)" (?myassert_win32@pfc@@YAXPEB_W0I@Z) referenced in function __catch$??$service_add_ref_safe@Vcomponent_installation_validator@@@@YAXPEAVcomponent_installation_validator@@@Z$0
1>foo_playlists_tag.obj : error LNK2019: unresolved external symbol "char const * __cdecl core_api::get_my_file_name(void)" (?get_my_file_name@core_api@@YAPEBDXZ) referenced in function "public: virtual void __cdecl `anonymous namespace'::componentversion_myimpl::get_file_name(class pfc::string_base &)" (?get_file_name@componentversion_myimpl@?A0xa2c48e39@@UEAAXAEAVstring_base@pfc@@@Z)
1>foo_playlists_tag.obj : error LNK2019: unresolved external symbol "bool __cdecl core_api::are_services_available(void)" (?are_services_available@core_api@@YA_NXZ) referenced in function "protected: __cdecl service_factory_base::service_factory_base(struct _GUID const &,class service_factory_base * &)" (??0service_factory_base@@IEAA@AEBU_GUID@@AEAPEAV0@@Z)
1>foo_playlists_tag.obj : error LNK2019: unresolved external symbol "public: static bool __cdecl component_installation_validator::test_my_name(char const *)" (?test_my_name@component_installation_validator@@SA_NPEBD@Z) referenced in function "public: virtual bool __cdecl component_installation_validator_filename::is_installed_correctly(void)" (?is_installed_correctly@component_installation_validator_filename@@UEAA_NXZ)
1>foo_playlists_tag.obj : error LNK2001: unresolved external symbol "public: static class service_factory_base * service_factory_base::__internal__list" (?__internal__list@service_factory_base@@2PEAV1@EA)
1>foo_playlists_tag.obj : error LNK2001: unresolved external symbol "public: static struct _GUID const componentversion::class_guid" (?class_guid@componentversion@@2U_GUID@@B)
1>foo_playlists_tag.obj : error LNK2001: unresolved external symbol "public: static struct _GUID const component_installation_validator::class_guid" (?class_guid@component_installation_validator@@2U_GUID@@B)
1>U:\Repositories\foo_playlists_tag\x64\Debug\foo_playlists_tag.dll : fatal error LNK1120: 7 unresolved externals
========== Build: 0 succeeded, 1 failed, 3 up-to-date, 0 skipped ==========
这些错误来自哪里?我如何解决这些问题?

非常感谢您的帮助。

在用户kode54上找到了我的答案:

在VisualStudio2010中,必须将所有依赖项作为引用直接添加到要链接的项目中。您可以在项目的“属性”对话框中的“常用属性、框架和引用”下找到“引用”列表。旧式的依赖项对话框在VisualStudio2008之后似乎无法实现此目的


谢谢你的帮助;帮助我找到lib文件。

与问题相关的所有内容都应该在问题中。一旦外部主机洗牌其链接,链接到异地代码将使问题变得无用。但是,在你发布你在该链接上可能拥有的数百万行代码之前,请尝试将其制作成一个。谢谢你的建设性批评。你不是在开玩笑。两行。当然要为你那数以百万行的尖刻评论道歉。您所拥有的大部分都是链接器错误。确保已将所有库添加到Project->Properties->Configuration Properties->Linker->Input,并提供了任何必要的路径。我已将“shared.lib”添加到自述文件指定的Linker>Input,但问题仍然存在