User forums > Help

Program bloat and compile speed questions.

<< < (2/3) > >>

mandrav:

--- Code: ---#include <iostream>

int main()
{
std::cout << "Hello world!" << std::endl;
return 0;
}
--- End code ---

Result: 282,624 bytes


--- Code: ---
#include <stdio.h>
#include <stdlib.h>

int main()
{
printf("Hello world!\n");
return 0;
}
--- End code ---

Result: 5,632 bytes

As you can see, it really depends on the libraries used...

Yiannis.

heaveny38:
Yeah, I know, but this big code size difference happens only with my code, not when only using standard libraries. It's weird.

squizzz:
Can you post your source here?
I bet some people would enjoy playing with compiler switches... :)

heaveny38:
Well, it's about 300k of source files, it'S a library that I was working on to learn more about true C++ and templates. I guess I can't post it as a source block in the forum heh ;) Is there any other way? As I plan to drop it, there's no secret in there :)

EDIT:

The thing is, even when doing nothing, the exe is huge, meaning that a lot of stuff gets inside it even when not using it. Adding code in main.cpp hardly changes the size. It's as if everything was getting linked even though it wasn't used.

squizzz:

--- Quote ---The thing is, even when doing nothing, the exe is huge, meaning that a lot of stuff gets inside it even when not using it. Adding code in main.cpp hardly changes the size. It's as if everything was getting linked even though it wasn't used.
--- End quote ---

No matter what is happening, it should be possible to make it at least same size as it is in Dev-C++ (if MinGW versions are the same).

You can send it to: squizzz (at) gmail.com. I could take a look in my spare time. Anyone else? :D

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version