在windows中使用linux根库
我必须使用基于 ROOT cern 的 C++ 库。这些库是用 Linux 环境和 k dev 编写的,现在我必须在 Windows 中通过 Visual Studio 使用这些库。首先,我只是尝试在 Visual c++ 中编译一些标头 .h 和一些源代码 .cpp 以创建 dll。这些文件在 Linux 中编译没有任何问题。
因此,我在生成稍后可以在 csharp 中使用的工作 DLL 时遇到问题。
我收到的错误是 LNK 错误,即使我相信我在链接器中添加了必要的 .lib,它们是与 ROOT 相关的库。
错误如下:
Error 1 error LNK2001: unresolved external symbol "public: virtual void __thiscall Directory::ShowMembers(class TMemberInspector &)" (?ShowMembers@Directory@@UAEXAAVTMemberInspector@@@Z)
Error 2 error LNK2001: unresolved external symbol "public: virtual void __thiscall Directory::Streamer(class TBuffer &)" (?Streamer@Directory@@UAEXAAVTBuffer@@@Z)
Error 3 error LNK2019: unresolved external symbol "public: static class TClass * __cdecl Directory::Class(void)" (?Class@Directory@@SAPAVTClass@@XZ) referenced in function "public: virtual class TClass * __thiscall Directory::IsA(void)const " (?IsA@Directory@@UBEPAVTClass@@XZ)
如果有人能指出一些提示,我将非常感激!
I have to work with c++ libraries based on ROOT cern. These libraries were written with Linux environment and k dev and now I have to use these libraries in windows with Visual Studio. First I am just trying to compile some headers .h and some source codes .cpp in Visual c++ to create a dll. these files compiled without any problem in Linux.
So I have a problem generating a working DLL that I can use later in csharp.
The errors i am getting are LNK errors even though I believe I added the necessary .lib in the linker wich are libraries related to ROOT.
The errors are the following :
Error 1 error LNK2001: unresolved external symbol "public: virtual void __thiscall Directory::ShowMembers(class TMemberInspector &)" (?ShowMembers@Directory@@UAEXAAVTMemberInspector@@@Z)
Error 2 error LNK2001: unresolved external symbol "public: virtual void __thiscall Directory::Streamer(class TBuffer &)" (?Streamer@Directory@@UAEXAAVTBuffer@@@Z)
Error 3 error LNK2019: unresolved external symbol "public: static class TClass * __cdecl Directory::Class(void)" (?Class@Directory@@SAPAVTClass@@XZ) referenced in function "public: virtual class TClass * __thiscall Directory::IsA(void)const " (?IsA@Directory@@UBEPAVTClass@@XZ)
I'd really appreciate if someone could point to some hints!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您必须浏览这些库的源代码(这不是问题,因为 ROOT 是开源的)并找到这些方法的定义。这听起来似乎很明显,但似乎这些函数应该在其他地方定义
you'll have to browse on the source of those libraries (not a problem, since ROOT is open source) and find the definitions for those methods. It might sound obvious, but it seems those functions are supposed to be defined elsewhere
不幸的是,这是不可能的。如果您有源代码,则必须在 Windows 上重新编译这些库。否则,请向供应商询问 Windows 版本。
Unfortunately, this is not possible. You have to re-compile those libraries on Windows if you have source code. Otherwise ask the vendor for a Windows version.
以下是一些可能对您有用的链接。
http://www.cyberciti.biz/faq/how-do-i-create-files-needed-to-build-and-use-dlls-under-linux/
http://www.kegel.com/crosstool/
祝你好运
Here are some links that might be useful for you.
http://www.cyberciti.biz/faq/how-do-i-create-files-needed-to-build-and-use-dlls-under-linux/
http://www.kegel.com/crosstool/
Good luck