visual studio foobar2000组件构建错误

时间:2017-02-23 00:34:07

标签: c++ visual-studio sdk

我一直在关注foobar2000组件的开发教程,但只用最少的代码就一直在构建错误。我的VS解决方案包括foobar2000 SDK中的这些项目:foobar2000_component_client,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 ==========

这些错误来自哪里?我该如何解决这些问题呢?

非常感谢任何帮助。

1 个答案:

答案 0 :(得分:0)

用户kode54在hydrogenaud.io找到了我的答案:

  

在Visual Studio 2010中,必须将所有依赖项直接添加到要尝试链接的项目中,作为引用。您可以在Common Properties,Frameworks和References下的项目的Properties对话框中找到引用列表。旧样式依赖项对话框似乎在Visual Studio 2008之后不能用于此目的。

感谢您的协助;帮我找到了lib文件。