2012-07-25 25 views
0

所以我是新來的C + +和在過去幾天我一直在試圖讓程序來編譯。我爲我的幻像OMNI下載了OpenHaptics,並一直試圖獲得一個簡單的球體程序來編譯。它給我的錯誤如下(我正在使用Visual c + + 2010)OpenHaptics不compliling

我認爲問題是它可能不會讀取glut32.dll文件(基於互聯網研究)如何添加此.dll文件,以便編譯器看到它,或者如果有另一個問題,我該如何解決它?

------ Build started: Project: Spheretest, Configuration: Debug Win32 ------ 
Sphereguts.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void  __cdecl qhStart(void)" ([email protected]@YAXXZ) referenced in function _main 
Sphereguts.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall QHRenderer::tell(class Cursor *)" ([email protected]@@[email protected]@@Z) referenced in function _main 
Sphereguts.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall Cursor::Cursor(void)" ([email protected]@[email protected]) referenced in function _main 
Sphereguts.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall QHRenderer::tell(class Sphere *)" ([email protected]@@[email protected]@@Z) referenced in function _main 
Sphereguts.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall Sphere::Sphere(void)" ([email protected]@[email protected]) referenced in function _main 
Sphereguts.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall QHRenderer::tell(class DeviceSpace *)" ([email protected]@@[email protected]@@Z) referenced in function _main 
Sphereguts.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall DeviceSpace::DeviceSpace(void)" ([email protected]@[email protected]) referenced in function _main 
Sphereguts.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QHGLUT::QHGLUT(int,char * * const)" ([email protected]@[email protected]@Z) referenced in function _main 
MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol [email protected] referenced in function ___tmainCRTStartup 
C:\Users\Ryan Grainger\Desktop\c++ test\Spheretest\Debug\Spheretest.exe : fatal error LNK1120: 9 unresolved externals 

==========生成:0成功,1失敗,0上最新,0已跳過==========

+0

聽起來像你沒有鏈接到OpenHaptics庫。 – cdhowie 2012-07-25 22:47:42

+0

好吧,我厭倦了開放觸覺不起作用,所以我基本上有一個文件夾現在與我連接的所有內容。 – 2012-07-25 23:03:05

回答

0

確保您正在列出您鏈接的庫的.lib文件。

另外...在你的源代碼中沒有main()。或者,相反,沒有Windows特定的模擬稱爲WinMain() - 並且鏈接器不喜歡它。

您需要提供WinMain(),或建立一個非Windows可執行文件(只是一個console application?),或包括所有必要的文件到您的解決方案(該組文件必須包含一個與它的WinMain()功能)

+0

這裏是在兩個柱 的#include //包含所有必要的標頭 INT主(INT的argc,字符* argv的[]){ \t \t * QHGLUT =的DisplayObject新我的源代碼QHGLUT(argc,argv); //創建一個顯示窗口 return 0; } – 2012-07-25 22:59:48

+0

DeviceSpace *全方位=新DeviceSpace; //查找默認幻影設備 DisplayObject->告訴(全方位); //告訴Quickhaptics是全方位存在 球* SimpleSphere =新球; //獲取球體 DisplayObject- >推薦(SimpleSphere); //告訴快速襻領域存在 光標* OmniCursor =新的遊標; //創建一個遊標 DisplayObject->告訴(OmniCursor); //告訴QuickHaptics一個光標所在 qhStart (); //設置所有動作 – 2012-07-25 22:59:54

+0

另外還有兩個版本的源代碼,我試圖編譯,第一個是針對GLUT,第二個針對Win32 – 2012-07-25 23:08:07