0

So I am new to c++ and over the last few days I have been attempting to get a program to compile. I downloaded OpenHaptics for my phantom OMNI and have been attempting to get a simple sphere program to compile. There errors it is giving me are as follows (I am using Visual c++ 2010)

I think the problem is that it might not be reading a glut32.dll file (based on internet research) how do I add this .dll file so that the compiler sees it, or if there is another problem how do i fix it?

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

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Charles
  • 50,943
  • 13
  • 104
  • 142

1 Answers1

0

Make sure you are listing the .lib files for the library you are linking-in.

Also... There's no main() in your source code. Or, rather, there's no Windows-specific analog called WinMain() - and the linker doesn't like it.

You need to provide the WinMain(), or build a non-Windows executable (just a console application?), or include all the necessary files into your solution (the set of files must contain the one with the WinMain() function in it)

YePhIcK
  • 5,816
  • 2
  • 27
  • 52
  • here is my source code in two posts #include //Include all necessary headers int main(int argc, char *argv[]) { QHGLUT* DisplayObject = new QHGLUT(argc,argv);//create a display window return 0; } – Matthew Rayl Jul 25 '12 at 22:59
  • DeviceSpace* Omni = new DeviceSpace;//Find the default Phantom Device DisplayObject->tell(Omni);//Tell Quickhaptics that omni exists Sphere* SimpleSphere = new Sphere;//Get a sphere DisplayObject->tell(SimpleSphere);//Tell Quick Haptics that the sphere exists Cursor* OmniCursor = new Cursor;//Create a cursor DisplayObject->tell(OmniCursor);//Tell QuickHaptics that a cursor exists qhStart();//Set everything in motion – Matthew Rayl Jul 25 '12 at 22:59
  • Also there are two versions of the source code I am trying to compile, the first is for GLUT and the second is for Win32 – Matthew Rayl Jul 25 '12 at 23:08
  • Don't add your source to the comments. If it's relevant then update the question. – Bart Jul 25 '12 at 23:25