Archived

This topic is now archived and is closed to further replies.

spud

MSVC++ 6.0 - Specific: Compiling my OpenGL Stuff

Recommended Posts

spud    122
So I have this program that I''ve built using knowledge from the Nehe tutorials, and other tutorials all over the net, and it compiles just fine as a debug build. However, if I wanted to trim down the filesize a little, I try a release build, but I get a lot of linker errors about unresolved externals. How do I fix this?

Share this post


Link to post
Share on other sites
MadKeithV    992
Your Release mode settings are most likely not the same as your Debug mode settings.

You can probably find both under Project->Settings. Compare the two (release/debug), specifically the libraries you are linking.

Share this post


Link to post
Share on other sites
spud    122
Yeah, you''re right. That was easy. You know how that jungle of context menus can be sometimes!

Now I have another question. What exactly does a debug build do that makes it so large?

Share this post


Link to post
Share on other sites
MadKeithV    992
It adds a lot of information and extra code to make sure that you can do things such as tracking the call stack, variable values, parameter values, and more such love. When a debug-mode program crashes violently, the debugger will be able to pick up the failed process, and still give you all the info you need.

In release mode, the extra code is left out. This means, if your program works correctly, it''s no different, except a lot smaller and faster. If it doesn''t work, it''s going to be much harder to find the error.

Share this post


Link to post
Share on other sites
spud    122
I knew about upx, but the compiler tweaks on your site rock. I got my demo (even though it''s only about 10 seconds of quality material, I still have about 9 minutes left to fill. ) down to 8.5 KB. That''s awesome! Anyone care to explain the technical aspect behind the multithreaded DLL usage and the /align:16xxx linker switch?

Anyone care to help me with this damn 9 minute demo I''m trying to make from someone who has never made an OpenGL demo in their life?

Share this post


Link to post
Share on other sites
spud    122
And release your 3D filebrowser, dangit. Actually, I've been using Litestep as a shell replacement to explorer.exe for over a year now, and I love it. However, I still don't have any other file browser besides explorer.exe, which crashes way too much for my comfort. I just need a tiny filebrowser, not a complete shell replacement, to take the place of Windows explorer and purge my system of any nasty Windows GUI influences forever.

[edited by - spud on October 5, 2002 1:12:35 PM]

Share this post


Link to post
Share on other sites
IainC    127
LOL... I know, I know

I''ve been getting so many emails hassling me about it since I put those screenshots up there

I shouldn''t really complain, it means people want to see it. As soon as I finish the little game project I''m on, I''ll port 3DShell to the latest incarnation of my engine. The codebase it''s running on is so hideous I daren''t even release an .exe...

Share this post


Link to post
Share on other sites
avianRR    100
Here''s why the one exe file size optimiztion works...
quote:

/ALIGN:number

This option specifies the alignment of each section within the linear address space of the program. The number argument is in bytes and must be a power of two. The default is 4K. The linker issues a warning if the alignment produces an invalid image.



I''d be carefull if your getting a compiler error. You never know what might happen on someone elses computer.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
but why are the .exe getting smaller with larger /ALIGN''s ? The default is 4k (=4096), the ''trick'' is setting it to 163xx. Is it simply because there are less sections?

Btw: nice trick anyway (thanks for showing it) got down a test .exe from 44k to 7k...

Share this post


Link to post
Share on other sites
IainC    127
avianRR - Although it will always warn if you''re not building a VXD, I''ve tested on every service pack of everything since Win 95 and never had any problems.

www.coldcity.com
code, pics, life

Share this post


Link to post
Share on other sites
LNK2001    218
With the /MD linker options, don''t forget that the C runtime DLL(s) have to be installed on the target machine. Maybe not an issue with MSVCRT.dll, but not everyone has msvcr70.dll and msvcp70.dll.

Share this post


Link to post
Share on other sites