Author Topic: Why are my dll's so big?  (Read 2998 times)

Offline download123

  • Multiple posting newcomer
  • *
  • Posts: 18
Why are my dll's so big?
« 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?

sethjackson

  • Guest
Re: Why are my dll's so big?
« Reply #1 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).

Offline download123

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: Why are my dll's so big?
« Reply #2 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?

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Why are my dll's so big?
« Reply #3 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".
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline download123

  • Multiple posting newcomer
  • *
  • Posts: 18
Re: Why are my dll's so big?
« Reply #4 on: May 01, 2006, 06:02:39 pm »
Thanks a lot...

What would I do without you all  8)