2011-07-15 21 views
2

我必須使用基於ROOT cern的C++庫。這些庫是用Linux環境和K開發的,現在我必須在Visual Studio的窗口中使用這些庫。首先,我只是想在Visual C++中編譯一些頭文件.h和一些源代碼.cpp來創建一個dll。這些文件在Linux中沒有任何問題編譯。在windows中使用linux根庫

所以我有一個問題,生成一個工作的DLL,我可以稍後在csharp中使用。

我得到的錯誤是LNK錯誤,即使我相信我在鏈接器中添加了必要的.lib,這些都是與ROOT相關的庫。

的錯誤有以下幾種:

Error 1 error LNK2001: unresolved external symbol "public: virtual void __thiscall Directory::ShowMembers(class TMemberInspector &)" ([email protected]@@[email protected]@@Z) 

Error 2 error LNK2001: unresolved external symbol "public: virtual void __thiscall Directory::Streamer(class TBuffer &)" ([email protected]@@[email protected]@@Z) 

Error 3 error LNK2019: unresolved external symbol "public: static class TClass * __cdecl Directory::Class(void)" ([email protected]@@[email protected]@XZ) referenced in function "public: virtual class TClass * __thiscall Directory::IsA(void)const " ([email protected]@@[email protected]@XZ) 

我真的很感激,如果有人可以指向一些提示!

+0

是的,從您的問題中不清楚您是否嘗試編譯ROOT庫或使用它們的程序。 – 2011-07-15 17:41:03

+0

你有沒有試過用cygwin或mingw編譯ROOT庫? ROOT網站對這個平臺/編譯器有什麼看法? – lurscher

回答

1

不幸的是,這是不可能的。如果您有源代碼,您必須在Windows上重新編譯這些庫。否則,請向供應商索取Windows版本。

0

你必須瀏覽這些庫的來源(不是一個問題,因爲root是開源的),並找到這些方法的定義。這可能聽起來很明顯,但似乎這些函數應該在其他地方定義