Saint
Saint

Reputation: 61

Linking Library In Visual Studio 2010

I'm doing some research on the side when I'm bored and I found this glut32.dll, glut32.h and glut32.lib files that should hold the function definitions (If I'm not mistaken) of several different functions that this source code uses.

I'm using Visual Studio 2010 so I have to add .lib files manually using the project's properties. So...

I go to build by code and get this error:

1>------ Build started: Project: simplVRML, Configuration: Debug Win32 ------
1>Build started 3/30/2011 7:46:45 AM.
1>InitializeBuildStatus:
1> Touching "Debug\simplVRML.unsuccessfulbuild".
1>ClCompile:
1> All outputs are up-to-date.
1>ManifestResourceCompile:
1> All outputs are up-to-date.
1>object.obj : error LNK2019: unresolved external symbol _arLoadPatt referenced in function _read_VRMLdata
1>object.obj : error LNK2019: unresolved external symbol _arVrmlLoadFile referenced in function _read_VRMLdata
1>simpleVRML.obj : error LNK2019: unresolved external symbol _arVrmlDraw referenced in function _main
1>simpleVRML.obj : error LNK2019: unresolved external symbol _arUtilTimerReset referenced in function _main
1>simpleVRML.obj : error LNK2019: unresolved external symbol _arglSetupForCurrentContext referenced in function _main
1>simpleVRML.obj : error LNK2019: unresolved external symbol __imp__arVideoCapStart referenced in function _setupCamera
1>simpleVRML.obj : error LNK2019: unresolved external symbol _arInitCparam referenced in function _setupCamera
1>simpleVRML.obj : error LNK2019: unresolved external symbol _arParamDisp referenced in function _setupCamera
1>simpleVRML.obj : error LNK2019: unresolved external symbol _arParamChangeSize referenced in function _setupCamera
1>simpleVRML.obj : error LNK2019: unresolved external symbol _arParamLoad referenced in function _setupCamera
1>simpleVRML.obj : error LNK2019: unresolved external symbol __imp__arVideoInqSize referenced in function _setupCamera
1>simpleVRML.obj : error LNK2019: unresolved external symbol __imp__arVideoOpen referenced in function _setupCamera
1>simpleVRML.obj : error LNK2001: unresolved external symbol _arMatchingPCAMode
1>simpleVRML.obj : error LNK2001: unresolved external symbol _arTemplateMatchingMode
1>simpleVRML.obj : error LNK2019: unresolved external symbol _arglTexmapModeGet referenced in function _debugReportMode
1>simpleVRML.obj : error LNK2019: unresolved external symbol _arglDrawModeGet referenced in function _debugReportMode
1>simpleVRML.obj : error LNK2001: unresolved external symbol _arImageProcMode
1>simpleVRML.obj : error LNK2001: unresolved external symbol _arFittingMode
1>simpleVRML.obj : error LNK2019: unresolved external symbol __imp__arVideoClose referenced in function _Quit
1>simpleVRML.obj : error LNK2019: unresolved external symbol __imp__arVideoCapStop referenced in function _Quit
1>simpleVRML.obj : error LNK2019: unresolved external symbol _arglCleanup referenced in function _Quit
1>simpleVRML.obj : error LNK2019: unresolved external symbol __imp__arVideoDispOption referenced in function _Keyboard
1>simpleVRML.obj : error LNK2019: unresolved external symbol _arUtilTimer referenced in function _Keyboard
1>simpleVRML.obj : error LNK2019: unresolved external symbol _arglTexmapModeSet referenced in function _Keyboard
1>simpleVRML.obj : error LNK2019: unresolved external symbol _arglDrawModeSet referenced in function _Keyboard
1>simpleVRML.obj : error LNK2019: unresolved external symbol _arGetTransMatCont referenced in function _Idle
1>simpleVRML.obj : error LNK2019: unresolved external symbol _arGetTransMat referenced in function _Idle
1>simpleVRML.obj : error LNK2019: unresolved external symbol _arDetectMarker referenced in function _Idle
1>simpleVRML.obj : error LNK2019: unresolved external symbol __imp__arVideoGetImage referenced in function _Idle
1>simpleVRML.obj : error LNK2019: unresolved external symbol _arVrmlTimerUpdate referenced in function _Idle
1>simpleVRML.obj : error LNK2019: unresolved external symbol _arglCameraViewRH referenced in function _Display
1>simpleVRML.obj : error LNK2019: unresolved external symbol _arglCameraFrustumRH referenced in function _Display
1>simpleVRML.obj : error LNK2019: unresolved external symbol __imp__arVideoCapNext referenced in function _Display
1>simpleVRML.obj : error LNK2019: unresolved external symbol _arglDispImage referenced in function _Display
1>C:\Users\*\Desktop\AltReality\Pwork\simplVRML\Debug\simplVRML.exe : fatal error LNK1120: 34 unresolved externals
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.81
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I can confirm the problem is how I'm linking the library, I'm definitely doing something wrong because when I try to link other libraries to other projects the result is the same. I've looked online and I've tried several tutorials, but to no avail- could somebody please tell me what I'm doing wrong?

Upvotes: 3

Views: 51832

Answers (6)

pradeep
pradeep

Reputation: 1

try this

#pragma comment(lib, "dev\\lib\\avformat.lib")

Upvotes: -1

yayay
yayay

Reputation: 260

I was having this problem when I was building a 32-bit application and trying to link to a 64-bit library. Maybe your are having the exact same problem or maybe the reverse. Maybe you are trying to link to a 32-bit library from a 64-bit executable.

To fix this in Visual Studio, go to the Configuration Manager. Select the correct platform or create a new platform if needed.

Upvotes: 1

Tim Howe
Tim Howe

Reputation: 61

As the previous post says, make sure your .dll/.lib file(s) are in the same directory as the .exe/.dll you are building and then go to your project's "Solution Explorer", right-click on the project name, choose "Add" -> "Existing Item...", then select the .dll/.lib file you want to include.

You should now see the .dll/.lib file listed below the "Source Files" section in the "Solution Explorer". I was seeing the same errors until I performed the steps I just described.

Also, make sure that your header file(s) are included in the project and referenced in the source files appropriately.

Upvotes: 6

JCooper
JCooper

Reputation: 6525

None of the link errors are for GLUT functions. It looks like you're not linking against the ARToolkit library. That will be a different library that also needs to be included in your input line.

Upvotes: 6

Jason
Jason

Reputation: 3307

Try to put .dll and .lib files needed into your project directory.

Upvotes: 1

Eamonn McEvoy
Eamonn McEvoy

Reputation: 8986

A few things for you to try:

  1. Do you have the Dll in the same directory as your exe?
  2. Is your .h added to your solution?
  3. Have you added the line #include "glut32.h"?
  4. Try adding the lib to your solution instead of the project properties.(not ideal but it should get it to compile for now)

Hope this helps, Eamonn

Upvotes: 0

Related Questions