Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript |
c++ - 367KB For Hello World !!
Ok I am sure someone is going to be able to tell me that there is something else I can do here to reduce the size from 367KB. I compiled dmc hello -o+space & dmc hello -o both file sizes were almost the same, the -o+space was slightly higher by a few bytes. I know in GCC you can pass -s to the linker to strip symbols to reduce the exe, is there something similar in dmc or is 367KB the best I can hope for in a 5 line console ?? I am not overly bothered size isnt everything <g> as I discovered a slightly larger program 10 lines does not increase excessivley over the 367KB Any ideas please ? Jul 29 2003
"Yeric" <REMOVEamigabloke yahoo.co.ukREMOVE> wrote in message news:bg6lka$2e0g$1 digitaldaemon.com...I compiled dmc hello -o+space & dmc hello -o Jul 29 2003
I wrote a hello world with printf and then with iostream, using stlport and dmc 8.35: printf: 38 KB cout: 366 KB You can try the printf/cout test with most compilers, and I guarantee that you will mostly get higher footprints for the iostream use. Bjarne Stroustrup says (in The C++ Programming Language), that this is a misconception and it's all based on your library provider. Well, I've used a lot of different compilers/libraries and always have seen the same thing. Think about printf/scanf over the cout/cin family. -- Regards, Gregory Peet Fellow Digital Martian STLSoft FAQ: http://stlsoft.gregpeet.com Jul 29 2003
Greg Peet wrote:I wrote a hello world with printf and then with iostream, using Jul 29 2003
Are you using the default SGI Library or STLPort? "Ilya Minkov" <midiclub 8ung.at> wrote in message news:bg6upt$2n5b$1 digitaldaemon.com...Greg Peet wrote: > I wrote a hello world with printf and then with iostream, using stlport and > dmc 8.35: > > printf: 38 KB > cout: 366 KB Oh c'mon! I used the STL included with DMC. dmc hello.cpp -Nc -6 -o With my stubborn Hello program, result: .exe 48156 bytes .obj 829 bytes With a standard hello world: .exe 47132 bytes .obj 376 bytes Stubborn Hello Source: --- 8< --- #include <iostream.h> int main (int argc, char *argv[]) { char quit = '\0'; while (quit != 'q') { cout << "Hello ! This is a very simple but stubborn console app." << endl; cout << "\tPress q to quit " << endl; cin >> quit; } return 0; } --- >8 --- -i. Jul 29 2003
I wrote a hello world with printf and then with iostream, using stlport Jul 30 2003
Hmmm Much fiddling later in IDDE and I have managed to get exe to 18kb How? In project settings set use dll runtime library ans et voilla 18kb however if you use the system ( "PAUSE" ) ; in program it crashes ouch but if you use cin >> some int ; it doesn't, anyone know what causes this ??? cheers Yeric Aug 12 2003
Yeric wrote:Hmmm Aug 12 2003
<g> yes, I could get prog to compile in about 18kb with command line before, but wanted to use the idde, well if you got it use it, I say <g>Walter already said the DLL RTL support was broken. Aug 13 2003
You have a file called "hello" containing the source? Are you using the C Jul 30 2003
|