Forgot to mention: under MSVC, I've put /OPT:NOREF to avoid symbols from being 
excluded when linking static libs.

Sukender
PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/

----- "Sukender" <suky0...@free.fr> a écrit :

> Hi Laurens, hi all,
> 
> Hum, could you give me a hint, please? If I write:
>   class BBB : public osgDB::ReaderWriter {... blah blah blah ...};
>   REGISTER_OSGPLUGIN(bbb, BBB)
> in "bbb.cpp" (in my main exe), then the "BBB" reader/writer is
> constructed and added to the registry when process loads.
> 
> However if I put that .cpp in a static lib, which is linked to my main
> exe, then the "BBB" reader/writer is never built (nor added to the
> registry).
> As far as I know, static libs are roughly a bunch of objects! Were's
> the difference?
> 
> And of course, using USE_OSGPLUGIN() doesn't work.
> 
> 
> BTW, The feature you're mentioning seems interesting. Is there any
> chance you release the code, under a licence or another?
> Cheers,
> 
> Sukender
> PVLE - Lightweight cross-platform game engine -
> http://pvle.sourceforge.net/
> 
> ----- "Laurens Voerman" <l.voer...@rug.nl> a écrit :
> 
> > Hi Sukender,
> >
> > my modified dds reader is able to skip reading high res mipmaps from
> > the
> > dds file.
> > For the version you are using, I am guessing that your link errors
> > might
> > originate in compliling the static plugin lib with
> OSG_LIBRARY_STATIC
> > defined. And/Or linking the plugin with the osg libs.
> > Mixing debug and release versions will also create confusing link
> > errors.
> >
> > Of course the USE_OSGPLUGIN(ext1) must be mirrored by a
> > REGISTER_OSGPLUGIN(ext1,myReaderWriterExtention1)
> >
> > Laurens.
> >
> > Sukender wrote:
> > > Hi Laurens,
> > >
> > > This is what I mean. Glad to see it can work! But I have:
> > > - A static lib
> > > - No dllexport stuff
> > > - Two USE_PLUGIN() in the main exe
> > >
> > > And I have linker errors.
> > > Any idea?
> > >
> > > BTW, what your modified plugin does? I had problems with DDS (saw
> > some 3rd-party apps read RGB as BGR and vice-versa).
> > > Cheers,
> > >
> > > Sukender
> > > PVLE - Lightweight cross-platform game engine -
> > http://pvle.sourceforge.net/
> > >
> > > ----- "Laurens Voerman" <l.voer...@rug.nl> a écrit :
> > >
> > >> Hi Sukender,
> > >> I'm very confused about Robert's reply, because it's working fine
> > for
> > >>
> > >> me. I am using a modified dds reader linked into my app, which
> > takes
> > >> precedence over any osgdb_dds.dll because it registers on
> startup.
> > >> This
> > >> can be done by simply adding the (modified) ReaderWriterDDS.cpp
> to
> > the
> > >>
> > >> project producing the executable, in this version there is no
> need
> > for
> > >>
> > >> USE_PLUGIN() - it will cause a link error.
> > >> If you compile the plugin into a static link lib, you need the
> > >> USE_PLUGIN() and link to the lib.
> > >>
> > >> This can work because the plugins I am using are not exporting
> any
> > >> symbols, so there is no __declspec(dllexport) stuff in the way.
> > >>
> > >> Laurens.
> > >>
> > >> Robert Osfield wrote:
> > >>> Hi Sukender,
> > >>>
> > >>> On Tue, Apr 6, 2010 at 10:15 AM, Sukender <suky0...@free.fr>
> > wrote:
> > >>>> Hi all,
> > >>>>
> > >>>> I found several ressources(*) about static linking but didn't
> > found
> > >> an answer to my question: can I combine "dynamic OSG/OT" +
> "dynamic
> > >> OSG plugins" + "static custom (= user) plugins"? If yes, how?
> > >>> I can't see how this would work as it seems to be there would be
> a
> > >>> conflict between what version of core libraries that the dynamic
> > vs
> > >>> static plugins would need to link to.
> > >>>
> > >>> If you want dynamic linking then use it everywhere.
> > >>>
> > >>> Robert.
> > >>> _______________________________________________
> > >>> osg-users mailing list
> > >>> osg-users@lists.openscenegraph.org
> > >>>
> > >>
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> > >> _______________________________________________
> > >> osg-users mailing list
> > >> osg-users@lists.openscenegraph.org
> > >>
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> > > _______________________________________________
> > > osg-users mailing list
> > > osg-users@lists.openscenegraph.org
> > >
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> > _______________________________________________
> > osg-users mailing list
> > osg-users@lists.openscenegraph.org
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to