> -----Original Message----- > From: Jeffrey Walton [mailto:[EMAIL PROTECTED] > Sent: den 10 november 2005 07:17 > To: [email protected] > Subject: Re: Size of executable > > Hi JPB, > > Is your program using a debug build of the library? It > appears (since no -g > options) the final program is not asking for Debug symbols. > Would g++ warn > you of mixing debug/release versions? > > My release builds of a typical CLI on a Windows platform (non MFC, > multi-threaded CRT) is about 200KB. Again I apologize - I'm > too far detached > from a *nix environment. > > Jeff > > > > -----Original Message----- > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > Sent: den 10 november 2005 03:53 > > To: '[email protected]' > > Subject: Size of executable > > > > Hello, > > I cannot seem to get the size of my executables down > to a reasonable > > size. For example the simple program I posted to the list > yesterday is in > > excess of 1.5Mb. I have managed to get the size down a few > hundred kb but > > still it's quite large for so little code (added strip-all and that > reduced > > it a couple of hundred Kb and so did removing static > option). This is my > > comiler command, am I missing something? > > > > g++ userinput.cpp -lcryptopp -L/usr/local/lib > -Wl,--strip-all -o shatest > > > > I have read through the info in the FAQ but still I cannot > seem to keep > the > > size down. Here are the includes CryptoPP, I am linking to > the FreeBSD > port > > and not the fiels I compiled myself as that made the > executable larger: > > > ************************************************************** > ************** > > *** > > > > OK that was weird, dropped my keyboard and accidentally > sent the email > > before I was done typing :).. What are the chances!? Anyhow > to continue. > > Here are the includes: > > > > #include "/usr/local/include/cryptopp/modes.h" > > #include "/usr/local/include/cryptopp/hex.h" > > #include "/usr/local/include/cryptopp/filters.h" > > #include "/usr/local/include/cryptopp/osrng.h" > > #include "/usr/local/include/cryptopp/sha.h" > > #include "/usr/local/include/cryptopp/hmac.h" > > #include <string> > > #include <iostream> > > > > Any ideas? > > > > // jpb > > > > >
Hmmm.... No the version made in the ports tree should be a release build. Also I tried adding -Os (optimize for size) but it did absolutely nothing!? I am obviously missing something, there is no way a < 40 lines of code program should result in a 1.6Mb executable?! I'll try a FreeBSD specific list and see if I can get some help. Thanks anyhow for the tips. // jpb
