VC, GL, and DLL - Please Just Get Along

How do I link glut32.dll in my program in VC++ so that I won’t need in the same directory as the program everytime I run it?

How do you get rid of the console window and still use GLUT?

Put glut32.dll in C:\Windows\System with your other dll’s. I don’t think you can get rid of the console using GLUT. Besides, it’s great for debugging. If you don’t want the console, you’ll have to write a win32 or MFC app I think.

Thanks ffish, but I saw somewhere that you can change a setting from console to window or something, but I don’t know how or where.

Taken from the original GLUT FAQ:

Q36: How do you avoid the Console window appearing when you compiler a Win32 GLUT application with Microsoft compilers?

A36: Try using the following Microsoft Visual C compiler flags:

/SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup

These are linker options… if main or wmain are defined, MSVC build a CONSOLE app by default; hence the need for /SUBSYSTEM:WINDOWS. if /SUBSYSTEM:WINDOWS is defined, MSVC expects WinMain or wWinMain to be defined; hence the need to /ENTRY:mainCRTStartup (eg the entry point is the usual C main).

stdout/stderr are [apparently] not “attached”; output via printf is simply “eaten” unless redirected at the command-line or by a parent program.

Information thanks to Jean-David Marrow (jd@riverbed.com).

Hey, thanks Michael! Very handy Vielen Dank

Great, except, how do you use it. Where do you go to put subsystem windows and all that stuff.

I’m more of a “let the complier handle it and don’t mess with anything with ‘system’ on it” kind of person. I have been programming with VC++, and C++ in general, since about last august.

The flags are defined in the project/settings menu. There are the flags defined for compile and linker respectively.
Another resource for help may be the online help (look for SUBSYSTEM or ENTRY there)

I saw subsystem, but I didn’t see entry.

Careful, those settings crashed my computer! I’ve got an exam in 12 hours so I can’t research it now but have a look for both settings under VC++'s help index - they’re both there, I just don’t have time to research their effects.

<edit>Beat me to it, Michael! There’s a link to the ENTRY topic at the bottom of the SUBSYSTEM one on my computer</edit>

[This message has been edited by ffish (edited 06-18-2001).]

I looked up subsystem and entry an it said that if you use SUBSYSTEM:WINDOWS, the you have to use WinMainCRTStartup, not mainCRTStartup. This is fine, except that since I’m using GLUT, I don’t have a WinMain function, which you need according to the docs. HELP!!!

Huh? Beat you in what ffish?