[C++] Making a project, exe mysteriously big
Hey!
I'm making a project in C++, I'm trying out Rakkarsoft's networking API if anyone is interested. I added all the source files to my project, because that's what they say one should, and it wouldn't work otherwise.
Well, so there I am, experimenting. I'm pretty new to C++ too so I just tried to comment out all the code having to do with Rakkarsoft, and left just int main() { return 0; }, to see what would happen. I expected the .exe to be small as with my previous sample programs, but it is still (after commenting out) 6 MB. I thought the linker would only link in what is necessary so this surprises me a bit.
What is happening?
Also, what is the difference between .lib and .o files?
In Visual Studio, you can go under Build->Configuration Manager. You will see a list of all the projects in the current solution. Find the one you're interested in, and under the column labelled "Configuration", change from "Debug" to "Release".
Quote:Original post by tufflax
Hmm, how would I know if I'm in debug mode?
If you are using Visual Studio and it is in its default configuration, there should be a combo box that reads "Debug" in one of your toolbars. That's a dead giveaway.
Quote:Also, what is the difference between .lib and .o files?
Very roughly speaking, a .lib is a set of .o packaged for easy reuse.
I'm using DevCpp but I found where to turn off debug mode, but it's still almost as large. I mean, shouldn't it be small?
Quote:Original post by tufflax
I'm using DevCpp but I found where to turn off debug mode, but it's still almost as large. I mean, shouldn't it be small?
Are you linking in any libraries? Is there code in header files?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement