在windows中使用linux根库

发布于 2024-11-24 03:49:08 字数 989 浏览 1 评论 0原文

我必须使用基于 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

葮薆情 2024-12-01 03:49:11

您必须浏览这些库的源代码(这不是问题,因为 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

人心善变 2024-12-01 03:49:10

不幸的是,这是不可能的。如果您有源代码,则必须在 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文