The Wiki page on this issue
(http://www.openscenegraph.org/index.php?page=Tasks.Win32StaticLink) boldly
states to query the community for information regarding new instructions as
to how to get this to work. 

Generally, these instructions have worked pretty well. How are they not up
to date (other than some of the stuff appears to have built into the new
"static" project configurations)? 

The size of the resulting exe is much smaller than I expected ($$$!).

Having generated the all the static versions of all the OSG libraries and
plugins (*_s.lib), linking them into a final application is NOT as
straightforward as inserting a few initialization calls into the 'main'
function of an application. I followed the instructions on the Wiki, which
led me to this (mangled symbols extracted with dumpbin /linkermember:1 $i |
grep the_symbol):

#if defined(OSG_LIBRARY_STATIC)
  #pragma comment(linker,
"/include:?g_IVEReaderWriterProxy@@[EMAIL PROTECTED]
riter@@@osgDB@@A")
  #pragma comment(linker,
"/include:?g_readerWriter_RGB_Proxy@@[EMAIL PROTECTED]
iterRGB@@@osgDB@@A")

  // I'm not sure this is wise (preferable to putting it on the link line)
  #if defined(_DEBUG)
    #pragma comment(lib, "osgdb_fltd_s.lib")
  #else
    #pragma comment(lib, "osgdb_flt_s.lib")
  #endif
  #pragma comment(linker,
"/include:?g_fltReaderWriterProxy@@[EMAIL PROTECTED]
[EMAIL PROTECTED]@@@osgDB@@A")
  #pragma comment(linker,
"/include:?g_readerWriter_ATTR_Proxy@@[EMAIL PROTECTED]
riterATTR@@@osgDB@@A")
   // ...
   // ... ~60 symbols here
   // ...
#endif

I had to enumerate (force) the symbol for each record type in the FLT
plugin. Surely there must be a better way, either for the FLT plugin or for
any other.

Furthermore, I couldn't link-in the freetype plugin, in light of the fact
that freetype219(_D).lib (that it links with) is compiled with /MD(d), which
leads to unresolved externals. This point is addressed in step #1 on the
Wiki.
Is there any alternative to regenerating the dependency (freetype in this
instance) with /MT(d)? (as in redirecting/renaming symbols through arcane
instructions to the linker?) I just don't want to recompile freetype or
worse, double the number of dependency files such as:
- freetype219.lib, freetype219_D.lib, freetype219_D_s.lib, freetype219_s.lib
- gdal, static & dynamic x release & debug, ...
- glut, ...
- libpng, ...
- libtiff, ...
- libungif, ...
- zlib, ...
Not to mention the proliferation of OSG libraries and plugins, should you
need both static and dynamically linked versions (along with release and
debug)...

Dan


_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to