View Full Version : Release problems - LNK2001

04-21-2007, 09:31 PM
Hello all,

I recently started playing around with opengl after taking an intro to c++ class. I'm getting the hang of things, but have run into a problem when trying to build a release. I am using a console application for the below problem.

The debug builds work flawlessly. I use the command line parameters /SUBSYSTEM:WINDOWS & /ENTRY:mainCRTStartup during debugging, which stops the lnk2001 error. But when I go to build a release, I get a lnk2001 error saying that it basically cannot locate the winmain entry point (well duh!).

So I tried telling the linker to point to mainCRTStartup, but it still wants to point to winmain. I have browsed the web, and all the answers are basically "make sure you are using the right subsystem" or "use /entry [function]". Perhap I am using the /entry function in the wrong place?

If someone could be so kind to tell me how to build my project for release? I am using gl and glut, I'm using MSVS 8.0 and winxp. If that helps, lol :p

Thank you,

04-22-2007, 03:30 AM
Heya, Elf. Things should work correctly if you choose "Win32 Console Application" instead of "Win32 Application" (or "MFC Application"). You shouldn't need to deal with the linker parameters.

This may help:

Let me know if that works for you! Happy programming =)

04-22-2007, 11:50 PM
Hey Canukle,

This is one of the faqs I have viewed previous to posting this, hehe :p

I have the application set to win32 console, I have all the gl/glut libraries added to the additional libraries in the linker properties, and I even specific for the linker to use mainCRTStartup, but it still gives me the error.

Is there any sort of solution that may be related to opengl/glut and the linker? Is there any other way to tell the linker where the entry point is?

Thanks for your time and help,

04-24-2007, 12:54 PM
Elf: Try to create a new project from scratch and run it. If that works, incrementally add the ogl stuff.