PDA

Click to See Complete Forum and Search --> : Filesize Huge!!!!


AAG
May 21st, 2001, 03:36 AM
I currently use borland c++ 5.0. i basic compiled .exe is around 32kb. i created an exact proggie in MSVC 6.0, and it was 152kb. WHY? how do i setup msvc so that it will make exes as small as borland does ? borland is very buggy and i'm getting tired of it, msvc is smooth on my computer and is actually pretty nice, it has better error handling than borland also from what i've experienced. can somebody please help me ?????? I do not use MFC just pure API. :)

HarryW
May 21st, 2001, 03:41 AM
Make sure that in the options all the optimisations are on, and you are compiling for the retail version, not debug version.

Vlatko
May 21st, 2001, 03:50 AM
If you are not sure how to do that then open your project and go:

Build Menu->Set Active Configuration and choose Win32 Release. Now compile the exe and it will be small.

AAG
May 21st, 2001, 03:54 AM
yo it actually made a smaller .exe the borland .exe was 36kb and the MSVC was 32kb :) thats pretty coo

One more question. The .exe compiles fine in borland c++, but in msvc, i get errors, there were a few can't convert long to char and char to long and stuff which i fixed, now i get this error

--------------------Configuration: program - Win32 Release--------------------
Compiling...
main.cpp
Linking...
main.obj : error LNK2001: unresolved external symbol __imp__mciSendStringA@16
Release/intelli.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

intelli.exe - 2 error(s), 0 warning(s)

i'm currently using the mciSendString function to create a quick Media player, why am i getting this error in msvc and not in borland ? i'm sorry, but i'm new to msvc. thanx for any input.

AAG
May 21st, 2001, 03:59 AM
I figured that out though :) hehe thanx for replying though i really appreciate it :)

parksie
May 21st, 2001, 10:52 AM
In Project Settings->Linker (make sure you're selecting the right build config) add "winmm.lib" to the list of libraries used.

AAG
May 21st, 2001, 05:27 PM
Yo thanx alot. That solved the problem and now the .exe works perfectly and is smaller in filesize than the one created in borland :)

AAG
May 21st, 2001, 05:53 PM
I have a .h file that i'm including in my main.cpp as follow

#include "functions.h"

i notice that MSVC has a headers folder in the workspace. I thought that by simply adding the functions.h file to the headers folder, MSVC would automatically include it, but it doesn't, i get errors about undeclared identifiers? why? isn't it supposed to automatically include them if u add them to the headers foleder ? could it have been something I changed, or is it just like that?

HarryW
May 22nd, 2001, 03:25 AM
Put the header file in the same place as your .cpp file. In the window on the left showing the files in your project, right click on the headers folder and choose to add an existing file to it, and add your header to the project.

parksie
May 22nd, 2001, 12:10 PM
Despite what the workspace is set up as, the compiler still only reads the source files. The different folders are for you, not the computer.

AAG
May 22nd, 2001, 03:20 PM
Thanx for the info. :)

parksie
May 22nd, 2001, 03:25 PM
Originally posted by HarryW
okay I completely misunderstood that last question, sorry for the useless answer :rolleyes: I thought you were asking something else. All information is GOOD :)

HarryW
May 22nd, 2001, 04:08 PM
Don't be so sure. Honeybee was informing us all about the details of his daily bowel movements. You can't tell me that's good.

parksie
May 22nd, 2001, 04:11 PM
You mean you're not interested in the chronology of someone's physical necessities? Damn...I must be the only one :rolleyes:

Why was he doing that, anyway?

HarryW
May 22nd, 2001, 04:42 PM
*****ed if I know, he was trying to make some kind of joke I think... just weirded me out personally. *Shudder*

HarryW
May 22nd, 2001, 04:44 PM
Oh and if you're really interested in that kind of thing, there's a few websites I could point out to you ;) heh

Today I saw movie which actually made me feel nauseous. I hope to do the same tomorrow :rolleyes:

AAG
May 22nd, 2001, 05:08 PM
MORE PROBLEMS WITH MSVC++

i just reinstalled msvc++. I made sure that winmm.lib was in the linker settings, i also have "Dont use precompiled headers" unchecked. I'm getting this warning message now.

LINK : warning LNK4089: all references to "WINMM.dll" discarded by /OPT:REF

i've looked for this /OPT:REF but cannot find it. what do i do ??

AAG
May 22nd, 2001, 07:02 PM
MSVC is wierd. at first, i had accidently told MSVC to link to winmm.dll. i got an error, so then i changed it to winmm.lib, and then i started getting the error i stated in my last reply. I created a new workspace, and added my source, headers, and resource files to it, linked to winmm.lib, and everything compiled without warnings of any kind :) oh well, everything is working fine now.