help for visual studio.net and openGL
Hi all....
i''ve been going abt picking up openGL and since i already have visual studio.net installed on my machine i kinda want to try using it.
I have downloaded GLUT and put the appropriate files in (what i hope are ) the appropriate directories
glui.h & glut.h in platformSDK/inlcude/gl
glui32.lib & glut32.lib in platformSDK/lib
glut32.dll in windows/system32
however when i try to run a couple sample programs, specifcally the ones that can be found at the following links:
http://www.cs.sfu.ca/people/Faculty/zhang/teaching/cmpt361/assign/lab0/simple.c
http://www.rivier.edu/faculty/amoreira/web/repository/opengl/glutsample/rottri.cpp
i find that i''m unable to compile because there are a lot of linker errors... what it looks like is that visual studio is not finding the GLUT libaries for some reason. Here is a sample error...
assign00 error LNK2019: unresolved external symbol _glutMouseFunc@4 referenced in function _main
the program ends up with abt 30 errors.
When i create a project in visual studio i''m not sure which one to use, I''ve tried
File->NEw->Project->C++ Projects->Win32 project (Blank Project)
and a couple others but they all seem to be giving me the same errors.
I would really appreceiate any help or suggestions people can offer in this matter. I''ve scoured the net but all the tutorials i can find are for VC++ 6.0
TIA.
Add the lib in linker''s settings, in "additional dependencies" (or something like that), so that the linker will consider it.
Also, the actual lib should be in one of the include paths, but you seem to have that covered.
-Nik
Also, the actual lib should be in one of the include paths, but you seem to have that covered.
-Nik
Niko Suni
You probably need to link some libraries (glut32.lib for one) to your project. I can be done under "project settings" in VC++ 6 if Im not mistaken, or you could put the following line somewhere in the code:
#pragma comment(lib, "glut32.lib")
If you still get warnings, look at the name of the unresolved symbol and figure out (or ask) which library it''s a part of and just add it/them as well.
#pragma comment(lib, "glut32.lib")
If you still get warnings, look at the name of the unresolved symbol and figure out (or ask) which library it''s a part of and just add it/them as well.
Goto your Project Properties. On the left look for the input page under linker. There you will see a line to add 'Additional Dependancies'. Add your "Glui32.lib, Glut32.lib" and any other libraries you'll be needing.
"Never have a battle of wits with an unarmed man. He will surely attempt to disarm you as well"
~Vendayan
[edited by - Vendayan on January 14, 2004 3:49:26 AM]
"Never have a battle of wits with an unarmed man. He will surely attempt to disarm you as well"
~Vendayan
[edited by - Vendayan on January 14, 2004 3:49:26 AM]
"Never have a battle of wits with an unarmed man. He will surely attempt to disarm you as well"~Vendayan
WOW...THX FOR THE QUICK REPLIES EVERYONE..!!... because i''m still kinda feeling my way around visual studio.net ( i was using visual studio 6.0 before and that was a couple years ago already ) i have some questions....
Also as an odd note when i went to try everyone''s suggestions, before i could modify anything the number of errors has mysteriously dropped to zero...i think it''s because i added the libraries to the directories while vc.net was running (?) and when i tstarted up maybe it reread the directories and found the libraries in question(?) ... I have no idea tho.... Here is the 1 error that is occuring now... It''s not present in either of the code samples i presented so I assume it must be located in one of the libraries...
assign00 error LNK2001: unresolved external symbol _WinMainCRTStartup
This question will sound so stupid but I''ve looked around and can''t find "Project Properties"... helping hand in the right direction please....
I''m assumming this is more or less the same suggestion as Vendayan''s. I did try adding #pragma comment(lib, "glut32.lib") right after the #include directives but that did not do anything.
Again...i think that this is the same suggestion as the ones above but please correct me if i''m wrong...
THX AGAIN EVERYONE...wat a great response time!!...
Also as an odd note when i went to try everyone''s suggestions, before i could modify anything the number of errors has mysteriously dropped to zero...i think it''s because i added the libraries to the directories while vc.net was running (?) and when i tstarted up maybe it reread the directories and found the libraries in question(?) ... I have no idea tho.... Here is the 1 error that is occuring now... It''s not present in either of the code samples i presented so I assume it must be located in one of the libraries...
assign00 error LNK2001: unresolved external symbol _WinMainCRTStartup
quote:
Original post by Vendayan
Goto your Project Properties. On the left look for the input page under linker. There you will see a line to add ''Additional Dependancies''. Add your "Glui32.lib, Glut32.lib" and any other libraries you''ll be needing.
This question will sound so stupid but I''ve looked around and can''t find "Project Properties"... helping hand in the right direction please....
quote:
You probably need to link some libraries (glut32.lib for one) to your project. I can be done under "project settings" in VC++ 6 if Im not mistaken, or you could put the following line somewhere in the code:
#pragma comment(lib, "glut32.lib")
If you still get warnings, look at the name of the unresolved symbol and figure out (or ask) which library it''s a part of and just add it/them as well.
I''m assumming this is more or less the same suggestion as Vendayan''s. I did try adding #pragma comment(lib, "glut32.lib") right after the #include directives but that did not do anything.
quote:
Add the lib in linker''s settings, in "additional dependencies" (or something like that), so that the linker will consider it.
Also, the actual lib should be in one of the include paths, but you seem to have that covered.
Again...i think that this is the same suggestion as the ones above but please correct me if i''m wrong...
THX AGAIN EVERYONE...wat a great response time!!...
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement