cmake broken in svn rev. 971?

Joczhen
Posts: 17
Joined: Thu Dec 20, 2007 3:17 pm

cmake broken in svn rev. 971?

Post by Joczhen »

Hi,

I'm not able to build the complete bullet project with the latest revision 971 from svn.

It fails because he tries to link multiple object files with function main together to one shared object file.

Code: Select all

Linking C shared library libLibXML.so
CMakeFiles/LibXML.dir/runtest.o: In function `main':
runtest.c:(.text+0x3cd0): multiple definition of `main'
CMakeFiles/LibXML.dir/runsuite.o:runsuite.c:(.text+0x1b40): first defined here
CMakeFiles/LibXML.dir/xmlcatalog.o: In function `main':
xmlcatalog.c:(.text+0x0): multiple definition of `main'
CMakeFiles/LibXML.dir/runsuite.o:runsuite.c:(.text+0x1b40): first defined here
CMakeFiles/LibXML.dir/xmllint.o: In function `main':
xmllint.c:(.text+0x4320): multiple definition of `main'
CMakeFiles/LibXML.dir/runsuite.o:runsuite.c:(.text+0x1b40): first defined here
collect2: ld returned 1 exit status
make[2]: *** [Extras/LibXML/libLibXML.so] Error 1
make[1]: *** [Extras/LibXML/CMakeFiles/LibXML.dir/all] Error 2
make: *** [all] Error 2
Below you'll find a patch to create a static library instead.

I'm pretty new to this project, so I don't know whether I'm doing something wrong or if cmake isn't intended to work.

2. there is a typo in Extras/BulletMultiThreaded/SpuParallelSolver.cpp (see patch below)

After these two simple changes make finished the build process.

Code: Select all

--- Extras/LibXML/CMakeLists.txt.old    2007-12-20 17:06:36.000000000 +0100
+++ Extras/LibXML/CMakeLists.txt        2007-12-20 17:06:51.000000000 +0100
@@ -5,7 +5,7 @@
 # Prevent MSVC from moaning
 ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS)
 
-ADD_LIBRARY(LibXML 
+ADD_LIBRARY(LibXML STATIC
                        c14n.c
                        catalog.c
                        chvalid.c

Code: Select all

--- Extras/BulletMultiThreaded/SpuParallelSolver.cpp.old        2007-12-20 17:31:07.000000000 +0100
+++ Extras/BulletMultiThreaded/SpuParallelSolver.cpp    2007-12-20 17:31:36.000000000 +0100
@@ -28,7 +28,7 @@
 #include "BulletCollision/CollisionShapes/btCollisionShape.h"
 #include "BulletCollision/CollisionDispatch/btCollisionObject.h"
 #include "BulletDynamics/ConstraintSolver/btTypedConstraint.h"
-#include "LinearMath/btQuickProf.h"
+#include "LinearMath/btQuickprof.h"
 
 #include "SpuSolverTask/SpuParallellSolverTask.h"
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: cmake broken in svn rev. 971?

Post by Erwin Coumans »

Thanks a lot for the fixes, cmake should be working and supported on all platforms.

btQuickprof should be lower-case, and there are some files in libxml project that should not be part of the library (they include 'main' methods and are probably for testing libxml).

Can you check if the latest trunk builds?
Thanks,
Erwin
Joczhen
Posts: 17
Joined: Thu Dec 20, 2007 3:17 pm

Re: cmake broken in svn rev. 971?

Post by Joczhen »

works very good now! Thanks!