I have a big header file.(produced by some code-generation
tool) ,that contains some typedefs for class template instatiations
and also some structs that are composed of this typedefs(akin to
PODs),add in some stl headers and one or two boost headers, so the
mere inclusion of the aforementioned header file increases the object
file size by some 800kb. I also have lots of source files(hundreds)
which are to be compiled into a library that indirectly includes this
header file.And it goes like;
classA.h
------------
#include "bigHeader.h"
class A{
public:
const Double1 & getSomeAttribute();
void setSomeAttribute(const Double1& val);
private:
Double1 someAttribute_;
};
classA.cpp
----------
#include "classA.h"
//class A implementation
classB.h
---------
#include "classA.h"
class B: public A{
public:
void setSomeAttribute(...);
... getSomeAttribute();
private:
WorldLocationStruct someAttribute_;
...
};
classB.cpp
----------
#include "classB.h"
//class B implementation
and so on....
Thing is , when i generate the library, linker just packs up the
object files and I end up with 800Mb library file that I cannot
distribute.So can I prevent the inclusion of this duplicate symbols in
the library seeing the objectfile for
classB.cpp includes everything classA.cpp has?
I tried to strip object files with cygwin utility strip, altohugh it
decreased object file size by half, it nowhere near enough good..
Any pointers would be greatly appreciated