链接器说 _IsolationAwareLoadLibrary 未定义 - 有什么想法吗?
我在代码中添加了一些增强内容*,但链接阶段失败:
错误 LNK2019:函数“void * __cdecl boost::interprocess::winapi::load_library(char const *)”中引用了无法解析的外部符号 _IsolationAwareLoadLibraryA@4 (?load_library@winapi@interprocess@boost@@YAPAXPBD@Z)
任何人都可以帮忙我弄清楚了吗? kernel32.lib 添加到链接器设置中。我搜索了 _IsolationAwareLoadLibraryA,它似乎不存在于我正在使用的 Windows SDK 6.0A 中。如果重要的话,该项目是 CLR。
* boost 的东西是两个共享内存头:
#include <boost/interprocess/shared_memory_object.hpp>
#include <boost/interprocess/mapped_region.hpp>
I added some boost stuff* to my code and the linking phase failed with:
error LNK2019: unresolved external symbol _IsolationAwareLoadLibraryA@4 referenced in function "void * __cdecl boost::interprocess::winapi::load_library(char const *)" (?load_library@winapi@interprocess@boost@@YAPAXPBD@Z)
Can anyone help me figure this out? kernel32.lib is added in linker settings. I searched for _IsolationAwareLoadLibraryA and it doesn't seem to be present in Windows SDK 6.0A, which I'm using. The project is CLR if that matters.
*the boost stuff are two shared memory headers:
#include <boost/interprocess/shared_memory_object.hpp>
#include <boost/interprocess/mapped_region.hpp>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
此函数是 SDK 7.0A 的一部分,它们应该是内联的(因此无需指定 .lib 文件)。尝试下载并使用较新的 SDK,并确保 ISOLATION_AWARE_ENABLED 已#define,因为这是触发包含这些函数的原因。我想 boost 应该由它自己定义。
This functions are part of SDK 7.0A, and they should be inline (so there's no need to specify an .lib file). Try downloading and using a newer SDK, and make sure that ISOLATION_AWARE_ENABLED gets #defined, because this is what triggers the inclusion of those functions. I guess boost should define it by itself though.
事实证明,我使用的项目在预处理器定义中添加了“ISOLATION_AWARE_ENABLED=1”。删除它修复了链接器错误。但不确定这是否会导致任何其他问题。令人不安的事实是,我浪费了大量时间来解决与使用第三方 C/C++ 库构建项目相关的各种问题。
It turned out the project I used had a "ISOLATION_AWARE_ENABLED=1" added to preprocessor definitions. Removing it fixed the linker error. Not sure whether this won't cause any other problems though. The disturbing fact is that I'm wasting lots of time just resolving various issues related to building my project with third-party C/C++ libraries.