View Full Version : Linking problems - very newbie

03-08-2004, 02:09 PM

I am completely new to openGL. I am using Visual C++ 6 on win2000. I have some code and I am trying to build it. At compilation I get no errors. This is what the error msg looks like when I try to link:

--------------------Configuration: Lesson2_test - Win32 Debug--------------------
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/Lesson2_test.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

Lesson2_test.exe - 2 error(s), 0 warning(s)

Can anyone see what the problem is from this? Or should I post the source code? Thanks in advance.

De Funies

03-08-2004, 02:43 PM

I'm newbie too, but i think, i can give you some advice.

1. Check your paths to include and lib directories. (In your case the lib directory is important).

2. Be sure you have linked the opengl32.lib, glu32.lib, and/or glaux32.lib, glut32.lib libraries. These first ones are surely needed. In Bloodshed Dev-CPP compiler, those libraries have got an lib- prefix (ex. libopengl32.lib).
A linkinkg option in VC++ and Dev-CPP is available in linker window. In Borland Builder 6, you just have got to select Project from main menu, and choose the option: Add to project.

3. You have got to have files with name as earlier and *.dll extension in your windows/system directory. I believe, you have they there. I just write this for any case.


03-08-2004, 03:25 PM
console app - entry point is main()
win32 app - entry point is WinMain()

you have created the wrong project for your source

03-08-2004, 09:09 PM

you could understand these linker errors if you install MSDN. just see the help section for these error codes and you'd know what to do to resolve them.

03-10-2004, 01:45 AM
Thanks for the help.

Yes I had created a console application project instead of a win32 application project. When I changed this it worked.

I can't install MSDN. When I try to install it it asks me which folder to install it in. But when I choose a folder it is not accepting it. It doesn't matter which folder I choose it won't accept it. Anybody know why? Thanks for the help!

De Funies