Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

obi-wan shinobi

A little help, please...for the new guy

This topic is 5728 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello! I''m interested in learning a little about programming in either DirectX or OpenGL, so recently I''ve been looking up tutorials on several websites and have found a couple of year-old pdf documents. I''ve downloaded some source code for beginning OpenGL tutorials, but when I try to compile and execute the code on my system in either Dev C++ or VC++ 6.0, I get various errors like "parse error", etc. I have yet to unzip the DirectX 9 sdk that I''ve downloaded, and most likely, I''m going to put that somewhere other than the C: drive on my system. I''ve successfully compiled and run OpenGL source code on other systems, but on mine, I get compiler errors. How can I tell exactly what files I need in what folders to get OpenGL or the DirectX sdk to work on my system. I''ve checked the "GL" folder in the C++ directory on my system, and it has gl.h, glu.h, and glaux.h, plus I manually added glut.h, glut32.dll, and glut.lib later on. What exactly do I need to have in terms of runtimes or whatever that''s called so the same codes that run on other systems with C++ will run on mine without errors and such? If anyone wants to e-mail me with a response or point me to a site that can clearly answer my questions, let me know in your posts...

Share this post


Link to post
Share on other sites
Advertisement
first thing i recommend is to forget about directx for the moment and concentrate on openGL (imho its a lot easier, especially when combined with GLUT)


what are your compilation errors dood?
make sure you are adding the right libraries Opengl32.lib(?) to your compilers linker. though if its compilation error, then it sounds like it can''t find the necessary header files.

i can only point you to nehe for help. it has a lot of good beginner tutorials on gl (including setting up various compilers to use it).

good luck

This room is green

Share this post


Link to post
Share on other sites
I get errors like "unresolved externals" in VC++. I''ve already tried the first 2 of NeHe''s tutorials, and I get 15 or 16 of those errors, which the compiler doesn''t point out to me when I double click on the message. I think I had found a working tutorial once, but I forgot where I found it and I don''t think it''s on my system anymore. Would it be better to buy a book from Amazon.com or something? I''ve tried searching on yahoo, etc. for how to get started with OpenGL/DirectX, but I haven''t found a good site for it yet...

Share this post


Link to post
Share on other sites
That usually means you are not linking in a required library or you are not including a necessary header file. If you list exactly what the undefined externals are, i''m sure someone on this forum could tell you what library that function(or whatever) is in.

Share this post


Link to post
Share on other sites
If the "unresolved externals" are referring to functions you wrote, you screwed up somewhere in your code. If they''re not referring to functions you made then you need to add libraries to your project. Probably opengl32.lib and possibly some others. Which functions exactly are unresolved?

Share this post


Link to post
Share on other sites
This is the list of unresolved externals. Keep in mind that I have not altered any of the libraries or any of NeHe''s source code...

Lesson1.obj : error LNK2001: unresolved external symbol _gluPerspective@32
Lesson1.obj : error LNK2001: unresolved external symbol __imp__glLoadIdentity@0
Lesson1.obj : error LNK2001: unresolved external symbol __imp__glMatrixMode@4
Lesson1.obj : error LNK2001: unresolved external symbol __imp__glViewport@16
Lesson1.obj : error LNK2001: unresolved external symbol __imp__glHint@8
Lesson1.obj : error LNK2001: unresolved external symbol __imp__glDepthFunc@4
Lesson1.obj : error LNK2001: unresolved external symbol __imp__glEnable@4
Lesson1.obj : error LNK2001: unresolved external symbol __imp__glClearDepth@8
Lesson1.obj : error LNK2001: unresolved external symbol __imp__glClearColor@16
Lesson1.obj : error LNK2001: unresolved external symbol __imp__glShadeModel@4
Lesson1.obj : error LNK2001: unresolved external symbol __imp__glClear@4
Lesson1.obj : error LNK2001: unresolved external symbol __imp__wglDeleteContext@4
Lesson1.obj : error LNK2001: unresolved external symbol __imp__wglMakeCurrent@8
Lesson1.obj : error LNK2001: unresolved external symbol __imp__wglCreateContext@4
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/Lesson1.exe : fatal error LNK1120: 15 unresolved externals
Error executing link.exe.

Lesson1.exe - 16 error(s), 0 warning(s)

Share this post


Link to post
Share on other sites
Okay...how do I do that? I''m not that experienced in messing with the options under VC++. If anyone has an OpenGL program that works on their PC, could you send it to me so I can see how if it will work on mine?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
place these at the top of your source:

#pragma comment ( lib, "opengl32.lib" )
#pragma comment ( lib, "glu32.lib" )

Share this post


Link to post
Share on other sites
quote:
Original post by Anonymous Poster
place these at the top of your source:

#pragma comment ( lib, "opengl32.lib" )
#pragma comment ( lib, "glu32.lib" )





or in VC6, in project->settings->all configurations->link->object,library modules add opengl32.lib, glu32.lib, glut32.lib ro whatever you need.

and you need a main() functions, as an entry point for your program.

make sure your .lib are in c:\Program Files\Microsoft Visual Studio\VC98\lib

if you want, you can add extra paths for the libraries, in tools->options->directories. The order in which the directories are listed is important, like putting the DX9 SDK at the top of the list.

you can add extra include paths to just the project you are working on in project->settings->all configurations->C, C++->Additional Include Directories.

[edited by - oliii on April 4, 2003 5:39:42 AM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!