Hi Iñaki,

I've just had a look at the OpenSceneGraph-2.8 branch and the osgText
plugin doesn't use the REGISTER_DOTOSGWRAPPER for the Text classes.
Unfortunately, this will mean that OpenSceneGraph-2.8.x and prior
versions won't be able to statically link the osgText.  Two things
would need adding, first the REGISTER_DOTOSGWRAPPER and second the use
of USE_DOTOSGWRAPPER(Text) for all the classes you wish to use from
the osgText plugin.  If you have a look at
src/osgPlugins/osg/ReaderWriterOSG.cpp you'll see lots of the
USE_DOTOSGWRAPPER.

The other alternative is to try out OpenSceneGraph from svn/trunk as
the .osg format and the new .osgx, .osgt and .osgb formats are now
supported in a bit of different way.  The osg plugin you'll include
using OSG_OSGPLUGIN(osg) and then the wrappers that provide the
implementation of the IO/serializer support you'll include for each
core library/NodeKit.  For instance it'll look like:

// pull in the osg plugin
USE_OSGPLUGIN(osg)

// pull in the old sytle .osg support
USE_DOTOSGWRAPPER_LIBRARY(osg)
USE_DOTOSGWRAPPER_LIBRARY(osgFX)
USE_DOTOSGWRAPPER_LIBRARY(osgParticle)
USE_DOTOSGWRAPPER_LIBRARY(osgShadow)
USE_DOTOSGWRAPPER_LIBRARY(osgSim)
USE_DOTOSGWRAPPER_LIBRARY(osgTerrain)
USE_DOTOSGWRAPPER_LIBRARY(osgText)
USE_DOTOSGWRAPPER_LIBRARY(osgViewer)
USE_DOTOSGWRAPPER_LIBRARY(osgVolume)
USE_DOTOSGWRAPPER_LIBRARY(osgWidget)

// pull in the serializers for the new .osgt, .osgb and .osgx formats
USE_SERIALIZER_WRAPPER_LIBRARY(osg)
USE_SERIALIZER_WRAPPER_LIBRARY(osgAnimation)
USE_SERIALIZER_WRAPPER_LIBRARY(osgFX)
USE_SERIALIZER_WRAPPER_LIBRARY(osgManipulator)
USE_SERIALIZER_WRAPPER_LIBRARY(osgParticle)
USE_SERIALIZER_WRAPPER_LIBRARY(osgShadow)
USE_SERIALIZER_WRAPPER_LIBRARY(osgSim)
USE_SERIALIZER_WRAPPER_LIBRARY(osgTerrain)
USE_SERIALIZER_WRAPPER_LIBRARY(osgText)
USE_SERIALIZER_WRAPPER_LIBRARY(osgVolume)

I'll be making a dev release this week that will wrap this up as well.

Robert.

On Mon, Nov 22, 2010 at 9:24 AM, Iñaki García <[email protected]> wrote:
> Hi Robert,
>
> I am using the following lines in my app for static linking (besides the
> full osg built into static libraries):
> USE_OSGPLUGIN(ive)
> USE_OSGPLUGIN(freetype)
> USE_OSGPLUGIN(osg)
> USE_OSGPLUGIN(bmp)
> USE_GRAPHICSWINDOW()
>
> I've tried an "USE_OSGPLUGIN(osgtext)", but it does not work, as nobody has
> ever registered that plugin. When I do that I receive:
> error LNK2001: unresolved external symbol _osgdb_osgtext
>
> That means to me that osgdb_osgtext function does not exist, and those
> osgdb_[plugin] functions are created in the REGISTER_OSGPLUGIN macro, in
> order to associate an "extension" to a ReaderWriter (for example osg to
> OSGReaderWriter).
> But no ReaderWriter[osgText] exists in the "Plugins osgtext".
>
> The list of registered plugins includes osgShadow, osgTerrain (named just as
> "terrain"), osgTgz and osgViewer, but not osgText (neither osgfx,
> osgparticle, osgsim and some others). Any reason for that, or it's just that
> nobody has needed it until myself?
>
> Iñaki
>
> El 19/11/2010 16:38, Robert Osfield escribió:
>>
>> Hi Iñaki,
>>
>> You'll need to include both the osg plugin and the osgText plugin.
>> What USE_OSGPLUGIN lines are you using right now?
>>
>> Robert.
>>
>> On Fri, Nov 19, 2010 at 10:13 AM, Iñaki García<[email protected]>  wrote:
>>>
>>> Hi all,
>>>
>>> When I save my scene to a "file.osg", osgText::Text nodes are not saved
>>> into
>>> the file. This happens only when I statically link OSG to my application,
>>> when I use the DLLs everything is OK. So I suppose that the "Plugins
>>> osgText" is not being registered/linked to my app. I have tried to use
>>> the
>>> macro USE_OSGPLUGIN(x), but it only works to link ReaderWriters of "x"
>>> extension.
>>>
>>> Is there any different way to instruct the compiler to link
>>> osgdb_osgtext.lib code, and tell the osgDB::Registry to use those
>>> functions
>>> to save Text nodes?
>>>
>>> Thanks in advance
>>> --
>>> *Iñaki García
>>> *
>>> _______________________________________________
>>> osg-users mailing list
>>> [email protected]
>>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>>
>> _______________________________________________
>> osg-users mailing list
>> [email protected]
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to