View Full Version : problems with VC++ and linking
07-16-2001, 03:13 PM
I know this isn't openGL related but I was wondering if anybody has any ideas as to what would cause this error:
LIBC.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Release/Triangle.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Triangle.exe - 2 error(s), 0 warning(s)
Am I forgetting an includes file or am I missing some .dll file. Any help as to where to look or what the problem might be would be especially helpful.
If your program has a main function ( not WinMain) should you create a console app.
07-17-2001, 07:45 AM
do you compile fine for a debug build (it looks like you are doing a release build, judging by the error returned)? if so, take a look at your project settings.
you may have something in your debug link settings that aren't present in your release.
[This message has been edited by dallas (edited 07-17-2001).]
07-17-2001, 12:20 PM
You are trying to compile a console and don't have a main function (thus the linker can't find it). You're most likely using a WinMain function for the entry point so you should start the app as a Win32 Application project, not a Win32 console project. The two projects are essentially the same except for the entry points they expect.
07-17-2001, 01:39 PM
I also had such problem, but when compiling .dll file. It may be solved in different ways:
1) play with your Code Generation option in project settings.
2) explicitly add msvcrt.lib(release) and msvcrtd.lib(debug) to your project.
07-17-2001, 03:06 PM
Thanks guys I'll give it a try and see what happens. Its probably the case because I was trying to get rid of GLUT in favor of a windows app. and using some directx.
07-17-2001, 03:41 PM
Sorry about the ineptitude but I'm really new to these types of errors. I didn't list all of the errors but they are very similiar and probably stem from the same problem. I don't know if I have all of the settings for the project right I changed my project to a win32 app. instead of a win32 console app. and now i'm getting all of these errors.
main.obj : error LNK2001: unresolved external symbol __imp__glEnd@0
main.obj : error LNK2001: unresolved external symbol __imp__glVertex3f@12
main.obj : error LNK2001: unresolved external symbol __imp__glBegin@4
main.obj : error LNK2001: unresolved external symbol __imp__glTranslated@24
main.obj : error LNK2001: unresolved external symbol __imp__glTranslatef@12
main.obj : error LNK2001: unresolved external symbol __imp__wglMakeCurrent@8
main.obj : error LNK2001: unresolved external symbol __imp__wglCreateContext@4
Debug/tank game.exe : fatal error LNK1120: 31 unresolved externals
Error executing link.exe.
You now have to add some *.lib to your project settings. Links fail because your declare some functions (in gl.h, glu.h and glaux.h) but VC++ can't find implementation of these. I think you need files like opengl32.lib and perhaps there are some other files like glu32.lib and glaux32.lib. I am quite sure it is your problem. And there is no problem with your questions, we all began one day....and at this time, I didn't know Opengl forum... : (
07-19-2001, 08:34 AM
Thnaks for the help I'll give it a try and see what happens.
07-19-2001, 08:43 AM
Thank you for your help I really appreciate it. It worked like a charm and I can finally get back to learning openGL instead of tinkering with vis. c++.
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.