← Back to team overview

yade-dev team mailing list archive

Re: ld: duplicated symbol (Mac OS X)

 

I have no idea on that, and googling that didn't find anything really
useful (besides extern inline you mentioned, which is not the case
here). I think you have problem with miniWm3 just because it is the
first lib that you link (right?) and it would be the same anywhere else.

No, for instance sqlite3 link just fine. It may be more clear in the following log where we can see that Wm3::String::operator unsigned int() const seems to be defines 2 times :

> /Users/richefeu/Documents/yade-local/build-vr/core/core.cpp
> /Users/richefeu/Documents/yade-local/build-vr/lib/miniWm3.cpp
> /Users/richefeu/Documents/yade-local/build-vr/lib/yade-support.cpp
C lib/sqlite3x/sqlite3x_command.cpp
C /Users/richefeu/Documents/yade-local/build-vr/lib/yade-support.cpp
C /Users/richefeu/Documents/yade-local/build-vr/lib/miniWm3.cpp
C /Users/richefeu/Documents/yade-local/build-vr/core/core.cpp
C lib/sqlite3x/sqlite3x_connection.cpp
C lib/sqlite3x/sqlite3x_cursor.cpp
C lib/sqlite3x/sqlite3x_exception.cpp
C lib/sqlite3x/sqlite3x_settings_db.cpp
C lib/sqlite3x/sqlite3x_transaction.cpp
L libsqlite3x.dylib
C lib/QGLViewer/qglviewer.cpp
L libminiWm3.dylib
C lib/QGLViewer/camera.cpp
C lib/QGLViewer/manipulatedFrame.cpp
C lib/QGLViewer/manipulatedCameraFrame.cpp
C lib/QGLViewer/frame.cpp
L libyade-support.dylib
⇒ /Users/richefeu/Documents/YADE/lib/yade-vr/lib/libyade-support.dylib
C lib/QGLViewer/saveSnapshot.cpp
C lib/QGLViewer/constraint.cpp
C lib/QGLViewer/keyFrameInterpolator.cpp
C lib/QGLViewer/mouseGrabber.cpp
C lib/QGLViewer/quaternion.cpp
C lib/QGLViewer/vec.cpp
C lib/QGLViewer/VRender/BackFaceCullingOptimizer.cpp
C lib/QGLViewer/VRender/BSPSortMethod.cpp
C lib/QGLViewer/VRender/EPSExporter.cpp
C lib/QGLViewer/VRender/Exporter.cpp
C lib/QGLViewer/VRender/FIGExporter.cpp
C lib/QGLViewer/VRender/gpc.cpp
C lib/QGLViewer/VRender/ParserGL.cpp
C lib/QGLViewer/VRender/Primitive.cpp
C lib/QGLViewer/VRender/PrimitivePositioning.cpp
C lib/QGLViewer/VRender/TopologicalSortMethod.cpp
C lib/QGLViewer/VRender/VisibilityOptimizer.cpp
C lib/QGLViewer/VRender/Vector2.cpp
C lib/QGLViewer/VRender/Vector3.cpp
C lib/QGLViewer/VRender/NVector3.cpp
C lib/QGLViewer/VRender/VRender.cpp
C extra/PeriodicInsertionSortCollider.cpp
> /Users/richefeu/Documents/yade-local/build-vr/packages.cpp
C /Users/richefeu/Documents/yade-local/build-vr/packages.cpp
L libyade-QGLViewer.dylib
U gui/qt3/QtGeneratedSimulationPlayer.ui
U gui/qt3/QtGeneratedSimulationPlayer.ui
L libyade-opengl.dylib
ld: duplicate symbol Wm3::String::operator unsigned int() constin / Users/richefeu/Documents/YADE/lib/yade-vr/lib/libyade-QGLViewer.dylib and /Users/richefeu/Documents/YADE/lib/yade-vr/lib/libminiWm3.dylib
collect2: ld returned 1 exit status
scons: *** [/Users/richefeu/Documents/yade-local/build-vr/lib/libyade- opengl.dylib] Error 1

It is not possible to install regular GNU toolchain instead of xcode?

I had compiled a version of gcc with openmp support (it was very long!).
here is the version:

$ g++ -v
Using built-in specs.
Target: i386-apple-darwin9.8.0
Configured with: ../gcc-4.3.4/configure --prefix=/opt/local --enable- languages=c,c++,objc,obj-c++,java,fortran --libdir=/opt/local/lib/ gcc43 --includedir=/opt/local/include/gcc43 --infodir=/opt/local/share/ info --mandir=/opt/local/share/man --with-local-prefix=/opt/local -- with-system-zlib --disable-nls --program-suffix=-mp-4.3 --with-gxx- include-dir=/opt/local/include/gcc43/c++/ --with-gmp=/opt/local --with- mpfr=/opt/local
Thread model: posix
gcc version 4.3.4 (GCC)

and I added a symbolic link:

$ which g++
/usr/bin/g++
$ ls -al /usr/bin/g++
lrwxr-xr-x 1 root wheel 25 1 sep 21:24 /usr/bin/g++ -> /opt/local/ bin/g++-mp-4.3

Unfortunately, scons fails at check level:

$ scons
scons: Reading SConscript files ...
@@@ Using profile default (scons.profile-default) @@@
Yade version is `vr', installed files will be suffixed with `-vr'.
All intermediary files will be in `/Users/richefeu/Documents/yade- local/build-vr'.
Checking whether c++ compiler "g++" works...no

Your compiler is broken, no point in continuing. See `/Users/richefeu/ Documents/yade-local/build-vr/config.log' for what went wrong and use the CXX/CXXFLAGS parameters to change your compiler.

Is there some official tech support for this system you paid for?

I think no... but I will investigate the matter.

Tomorrow, I will try to compile the complete Wm3 separately.
Thank you for help Vaclav. Has you know, compiling a soft on several OS make it more robust.

VR









Follow ups

References