Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: download123 on May 01, 2006, 05:06:30 pm

Title: Why are my dll's so big?
Post by: download123 on May 01, 2006, 05:06:30 pm
I don't understand it
I build dlls in form of

#include <windows.h>

#ifdef BUILD_DLL
    #define DLL_EXPORT __declspec(dllexport)
#else
    #define DLL_EXPORT
#endif

#include <string>
#include <iostream>
#include <time.h>
using namespace std;

struct rueckgabe
{
      ...
};

extern "C" DLL_EXPORT void PLUGM(std::string bef, rueckgabe *rueck)
{
   //some code... cout ... not much
return;
}

and the dll ist 1,21 Mb...

A friend made dlls with only 300kb .. whats the problem?
Title: Re: Why are my dll's so big?
Post by: sethjackson on May 01, 2006, 05:15:29 pm
Well for one you didn't tell us what compiler you or your friend used....... Maybe you are building the DLL in debug mode (this will make the output much larger).
Title: Re: Why are my dll's so big?
Post by: download123 on May 01, 2006, 05:42:10 pm
I use codeblocks with mingw....

(I'll ask my friend what he uses...)

how can i see if its debug mode.. btw. how can i cange it?
Title: Re: Why are my dll's so big?
Post by: thomas on May 01, 2006, 05:48:36 pm
Actually, this is not precisely a Code::Blocks issue.

Nevertheless:
Quote
#include <iostream>
That already causes massive bloat, especially when using gcc/MinGW. Don't include iostream if you don't absolutely have to.

Furthermore, you will want to check whether "generate debugging symbols" is turned on, and you may want to use "strip executable".
Title: Re: Why are my dll's so big?
Post by: download123 on May 01, 2006, 06:02:39 pm
Thanks a lot...

What would I do without you all  8)