Thanks, Stefan. Good catch.

I'm pretty sure this will be a problem on svn trunk too, if anyone were to try a static link there on a Linux/Darwin box.

What I _think_ is happening is this: By default, Linux/Darwin exports symbols from libraries. In a non-static build, shared object symbols are contained, so that's not going to be a problem either. But for static builds on Linux/Darwin, two plugins that have symbols with the same name will cause a conflict at link time. Does this sound right?

If this is an accurate description of the problem, then I can think of three ways to resolve the issue:

1) If I remember right, there is a way on Linux/Darwin to tell the linker to hide symbols rather than export them. It's been a while since I've done *nix development; this might just apply to shared objects.

2) We could use namespaces in the plugin. You might try this,

3) The ugly, but direct method would be to change the class names so that they are unique within the plugin. But honestly I'd prefer to use a namespace.

I don't think you're seeing a problem with FBX at this time because the XCode project files don't include the FBX plugin. But this might be an issue on other platforms that try to do a static build, so we should probably address it in some way as well.

Stefan, would you like to take a crack at option 2 above, and use a namespace qualifier in the 3DS plugin to see if it resolves this issue? If so, please submit your change. I'm willing to hold up the release for this fix.

Paul Martz
Skew Matrix Software LLC
_http://www.skew-matrix.com_ <http://www.skew-matrix.com/>
+1 303 859 9466



stefan nortd wrote:
Hi Paul,

I have a linker problem with the latest rc2 that I did not have with 2.8.2.



Code:

ld: duplicate symbol PrimitiveIndexWriter::drawArrays(unsigned int, int, int)in 
/Users/noema/Development/git/VirtualAwesome/libs/osg-osx/lib/libosgdb_obj.a(OBJWriterNodeVisitor.o)
 and 
/Users/noema/Development/git/VirtualAwesome/libs/osg-osx/lib/libosgdb_3ds.a(WriterNodeVisitor.o)
collect2: ld returned 1 exit status
Command /Developer/usr/bin/g++-4.2 failed with exit code 1



(xcode, snow leopard)

It looks to me that there a three occasions with an identical 
PrimitiveIndexWriter::drawArrays(...) function. It's in the obj, 3ds, and fbx 
plugin. I am using obj and 3ds together. I also link statically via the 
USE_OSGPLUGIN(...) call but I would assume the same error occurs when using the 
osg dynamically.

Any ideas?

Cheers,
stefan

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=26272#26272





_______________________________________________
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