Release problems - LNK2001

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 :stuck_out_tongue:

Thank you,

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 =)

Hey Canukle,

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

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,

Elf: Try to create a new project from scratch and run it. If that works, incrementally add the ogl stuff.