Advertisement

VC++ compiler - release mode?

Started by January 20, 2002 02:05 PM
5 comments, last by MAD_Mask 22 years, 7 months ago
I've made a litle game and I tried to build in with "win32 release" configuration .( This is the way if I want to give to people only the game not the source files ....right? It didn't worked giving me errors like this : "error LNK2001: unresolved external symbol __imp__timeGetTime@0 error LNK2001: unresolved external symbol __imp__timeGetTime@0 error LNK2001: unresolved external symbol _DirectSoundCreate@12" I've read in MVC++ help at "LNK2001" but this didn't help. In "win32 Debug" conifguration every thing is Ok and the game compiles and links ok. Any help on how to compile and link only a release version that could be given to other people without having to wory that they'l modify the code? MAD_Mask Edited by - MAD_Mask on January 20, 2002 3:18:07 PM
Make sure you're linking in all the correct .lib files - check for both Debug and Release mode, MSVC has seperate configurations for each.

<EDIT>Also, debug mode won't give out your source code, it just contains debugging symbols that will degrade performance and increase the file size (the output file), but on the upside let you debug your program. Generally, though, it is better to release the "Release" version. </EDIT>


DracosX:

Master of the General Protection Fault

Edited by - DracosX on January 20, 2002 3:18:55 PM
DracosX:Master of the General Protection Fault
Advertisement
You need to link to the libraries that have those functions.

I think you need ddraw.lib and winmm.lib (or winmm32.lib?)

- Pete
Hmm so there are separate file conifgurations for release and debug..... !!! I didn''t know that.
But one more thing : I compile and link the project in debug mode and it creates a new directory ( Debug) and in that directory is an exe file. But when I try to run it it exists imidiatly. Why? Is this becouse I have some resurce files ( bmp''s and wav''s ) and I have to put them in the same directory as the exe file? ( Debug) .
That sounds right.

Basically when you run a program, it has a "current directory". This isn''t necessarily the same directory the program is in, so this is why the program will run fine from VC++, but not when you double click it.

When you go to release your program, just put the Release version in the same directory as the files it loads.

Hope this helps.

- Pete
Yeap .
That worked. Thanks guys.
But the bmp for example still can be trashed (just using the simple and old MSPaint ) . I read somewere that you could include the bmp''s in the .exe file. Who can I do that? On the other hand I''veread in the same place that this isn''t very good because the .exe file can get quite big. So who do I just change the extension from "bmp" to other one so that it can''t be recognized by any draw program. ?
Advertisement
You xan use resource files to store data n''stuff (WAV''s BMP''s etc)

Now changing the file extension is a quick and dirty way of hiding files, but it is very easy to hack.

Most program will have their own custom file formats, you could still use a BMP file format but just add a few extra "code bytes" to front of the file, this will make it invalid for paint program, which will wonder what the hell the file is.

The only problem is that you will have to write you bmp loading routines to take this into account.

This topic is closed to new replies.

Advertisement