User forums > General (but related to Code::Blocks)

Why are my dll's so big?

(1/1)

download123:
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?

sethjackson:
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).

download123:
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?

thomas:
Actually, this is not precisely a Code::Blocks issue.

Nevertheless:

--- Quote ---#include <iostream>

--- End quote ---
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".

download123:
Thanks a lot...

What would I do without you all  8)

Navigation

[0] Message Index

Go to full version