paged geometry lib very big

mickey

04-02-2009 17:00:32

Hi

I'm about to release the source of my application, I used paged geometry but I wonder why the paged geometry lib is very big - 30mb.

If I tried to change my vc9 project settings -> Configuration Properties->General->Configruation type to "Dynamic link library(.dll)", i get dozens of unresolved external symbol. Here are some samples:

1>BatchedGeometry.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual class std::vector<class Ogre::Light *,class std::allocator<class Ogre::Light *> > const & __thiscall Ogre::MovableObject::queryLights(void)const " (__imp_?queryLights@MovableObject@Ogre@@UBEABV?$vector@PAVLight@Ogre@@V?$allocator@PAVLight@Ogre@@@std@@@std@@XZ)
1>BatchedGeometry.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual class Ogre::Matrix4 const & __thiscall Ogre::MovableObject::_getParentNodeFullTransform(void)const " (__imp_?_getParentNodeFullTransform@MovableObject@Ogre@@UBEABVMatrix4@2@XZ)

I was wondering if there's a way to greatly reduce the size of the library just like the other plugin libraries here (eg, caelum etc.,).

It just that this one adds 5mb(compressed) more to my zip package, if it just really is a few kb.

Fish

04-02-2009 17:48:16

Do you need to release the .lib file? Why not let folks just build the PG source and generate their own .lib?

The PG source does not not have dll exports defined in order to build a DLL in MSVC. If you use gcc or MinGW you can build a dll without the silly dll export definition requirements imposed by MS.

mickey

05-02-2009 06:38:42

Yes I would love to include the lib - together with the rest, caelum, paged geometry, mysql++.

Its because I want the users to able to just download my whole demo game, and compile it without needing to download/do anything else besides setting their OGRE SDK path.

So far, my game uses a total of 6 libraries - fmod, caelum, mysql++ etc., and they all zip well just under 2mb. When I added paged geometry, it balloons to 10mb. This will take my entire app to 30mb of download. I just want to reduce the size, and if the paged geometry's lib size can be minimize easily i would love to do that.

I don't use GCC and MingW unforutnately, I only have VC9 installed on my machine. I have GCC on my linux but then that means i have to go through compiling Ogre and paged geometry, but then compiling it in linux wouldn't make it work on windows right?

I guess I have to ask, is there an easy way to do this in vc9 ?

Thanks.

Fish

05-02-2009 14:08:34

Well, perhaps you could distribute the PG source along with your distro and include PG as a project in your MSVC solution file so that it automatically builds when the user builds the executable. Or, just build and distribute your executable with the other dependency dll's and include your source and dependency web-links in case the user wishes to compile the game.

edit: With MSVC8 my PG release build library is only 3.6megs with compiler switches /O2 /Ob2 /Oi /Ot /GF /EHa /MD /arch:SSE2 /fp:fast /GS-. My debug library is 12.7megs. I'm not sure why MSVC9 is bloating the lib so much, but I guess that is the trend with MS :roll: .

-Fish

mickey

07-02-2009 07:08:20

Hi Fish

Thanks for trying to help. It didn't work though on my VC9

I placed those commands as separated lines in the C++ tab->command.

Trimming it down to 3Mb is already perfect for me - as compared to 30mb which my VC produces now.

Do you think you have any other ideas? Perhaps somewhere near your 3mb size.

Fish

07-02-2009 12:55:54

By distributing source only you are assuming that the user has a certain level of competency with a compiler. Your pagedGeometry.lib will only be compatible with MSVC9, forcing owners of MSVC8/7/6, GCC, MinGW, Borland, Watcom, Intel, etc to rebuild PagedGeometry anyway. So you may as well distribute the PG source and license. :)

-Fish

mickey

08-02-2009 18:09:28

Ohh right... I didn't thought of that. I think its best to just distribute the source.

Thanks for pointing that out!