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

Re: enormous library size by Alexander

Alexander
Mon Jun 25 12:41:15 CDT 2007

With this much duplication, compressing it should yield
fantastic results (I wouldn't be surprised if you get close
to 99% compression). I know this isn't the answer you
were hoping for...

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@mvps.org
MVP VC FAQ: http://vcfaq.mvps.org
=====================================

"hurcan solter" <hsolter@gmail.com> wrote in message
news:1182616328.459821.327520@u2g2000hsc.googlegroups.com...
>
> 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
>