Jump to content
  • Advertisement
Sign in to follow this  
tufflax

[C++] Making a project, exe mysteriously big

This topic is 4417 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
If you are in debug mode, the executable will be larger than in release mode.

Share this post


Link to post
Share on other sites
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".

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!