gpt4 book ai didi

c++ - 这些链接器错误的含义是什么?

转载 作者:行者123 更新时间:2023-11-27 23:21:49 27 4
gpt4 key购买 nike

我希望我可以问“我需要链接哪些库”,但它非常具体(wwise 引擎集成),所以我需要帮助自己解决这个问题。当我尝试创建头文件中定义的类型的变量时出现问题(编译器发现头没有问题)。我收到 22 个链接器错误,但我不明白读出的内容,有人可以引导我完成它并准确告诉我缺少哪个符号,以便我找出缺少的库吗?除了没有链接的库之外,它还能是什么吗? Wwise 附带了一个演示项目,它可以编译但不会链接到比我更多的库。

这里有 5 个错误。我正在使用 visual studio。

1>main.obj : error LNK2019: unresolved external symbol "public: enum AKRESULT __thiscall CAkDefaultIOHookBlocking::Init(struct AkDeviceSettings const &,bool)" (?Init@CAkDefaultIOHookBlocking@@QAE?AW4AKRESULT@@ABUAkDeviceSettings@@_N@Z) referenced in function "bool __cdecl InitSoundEngine(void)" (?InitSoundEngine@@YA_NXZ)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall CAkDefaultIOHookBlocking::GetDeviceDesc(struct AkDeviceDesc &)" (?GetDeviceDesc@CAkDefaultIOHookBlocking@@UAEXAAUAkDeviceDesc@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual unsigned long __thiscall CAkDefaultIOHookBlocking::GetDeviceData(void)" (?GetDeviceData@CAkDefaultIOHookBlocking@@UAEKXZ)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual enum AKRESULT __thiscall CAkDefaultIOHookBlocking::Read(struct AkFileDesc &,struct AkIoHeuristics const &,void *,struct AkIOTransferInfo &)" (?Read@CAkDefaultIOHookBlocking@@UAE?AW4AKRESULT@@AAUAkFileDesc@@ABUAkIoHeuristics@@PAXAAUAkIOTransferInfo@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual enum AKRESULT __thiscall CAkDefaultIOHookBlocking::Write(struct AkFileDesc &,struct AkIoHeuristics const &,void *,struct AkIOTransferInfo &)" (?Write@CAkDefaultIOHookBlocking@@UAE?AW4AKRESULT@@AAUAkFileDesc@@ABUAkIoHeuristics@@PAXAAUAkIOTransferInfo@@@Z)

最佳答案

符号是:

enum AKRESULT CAkDefaultIOHookBlocking::Init(struct AkDeviceSettings const &,bool)
virtual void CAkDefaultIOHookBlocking::GetDeviceDesc(struct AkDeviceDesc &)
virtual unsigned long CAkDefaultIOHookBlocking::GetDeviceData(void)
virtual enum AKRESULT CAkDefaultIOHookBlocking::Read(struct AkFileDesc &,struct AkIoHeuristics const &,void *,struct AkIOTransferInfo &)
virtual enum AKRESULT CAkDefaultIOHookBlocking::Write(struct AkFileDesc &,struct AkIoHeuristics const &,void *,struct AkIOTransferInfo &)

据我所知,您只有声明类 CAkDefaultIOHookBlocking 的 header ,这意味着您尝试使用上述任何您需要链接到库的符号。

Wwise comes with a demo project that compiles but doesnt link to any more libraries than I do.

要么未使用符号,要么在该项目中编译了定义这些符号的源文件 - http://gmwwise.googlecode.com/svn-history/r2/trunk/GMWwise/wwise/AkDefaultIOHookBlocking.cpp

关于c++ - 这些链接器错误的含义是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12342361/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com