Error with make

adnap

22-08-2010 06:34:05

When I try to make OgreBullet, I get the following:

/bin/bash ../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../.. -I/usr/local/include -I/usr/local/include/OGRE -I/usr/local/include/bullet/bullet -I../include -g -O2 -MT OgreBulletCollisionsWorld.lo -MD -MP -MF .deps/OgreBulletCollisionsWorld.Tpo -c -o OgreBulletCollisionsWorld.lo OgreBulletCollisionsWorld.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../.. -I/usr/local/include -I/usr/local/include/OGRE -I/usr/local/include/bullet/bullet -I../include -g -O2 -MT OgreBulletCollisionsWorld.lo -MD -MP -MF .deps/OgreBulletCollisionsWorld.Tpo -c OgreBulletCollisionsWorld.cpp -fPIC -DPIC -o .libs/OgreBulletCollisionsWorld.o
OgreBulletCollisionsWorld.cpp: In constructor ‘OgreBulletCollisions::CollisionsWorld::CollisionsWorld(Ogre::SceneManager*, const Ogre::AxisAlignedBox&, bool, bool, unsigned int)’:
OgreBulletCollisionsWorld.cpp:68: error: ‘USHRT_MAX’ was not declared in this scope


I think USHRT_MAX is commonly defined in limits.h, which is part of the C standard library. I already have build-essential installed on my computer. I'm not sure what I need to do to fix this issue. Can anyone help?

Thanks!

Tapio

09-09-2010 09:19:03

Add
#include <limits.h>
to the Collisions/src/OgreBulletCollisionsWorld.cpp

EmileZola

09-09-2010 15:53:56

I had the same problem than the OP, adding <limits.h> did the trick but now I have other errors...


Utils/OgreBulletCollisionsMeshToShapeConverter.cpp:35:27: error: ConvexBuilder.h: No such file or directory
Utils/OgreBulletCollisionsMeshToShapeConverter.cpp:367: error: ‘ConvexDecomposition’ has not been declared
Utils/OgreBulletCollisionsMeshToShapeConverter.cpp:367: error: expected `{' before ‘ConvexDecompInterface’
Utils/OgreBulletCollisionsMeshToShapeConverter.cpp:367: error: function definition does not declare parameters
Utils/OgreBulletCollisionsMeshToShapeConverter.cpp: In member function ‘OgreBulletCollisions::CompoundCollisionShape* OgreBulletCollisions::VertexIndexToShape::createConvexDecomposition(unsigned int, float, float, unsigned int, float)’:
Utils/OgreBulletCollisionsMeshToShapeConverter.cpp:581: error: ‘ConvexDecomposition’ has not been declared
Utils/OgreBulletCollisionsMeshToShapeConverter.cpp:581: error: expected `;' before ‘desc’
Utils/OgreBulletCollisionsMeshToShapeConverter.cpp:583: error: ‘desc’ was not declared in this scope
Utils/OgreBulletCollisionsMeshToShapeConverter.cpp:594: error: aggregate ‘MyConvexDecomposition convexDecomposition’ has incomplete type and cannot be defined
Utils/OgreBulletCollisionsMeshToShapeConverter.cpp:596: error: ‘ConvexDecomposition’ has not been declared
Utils/OgreBulletCollisionsMeshToShapeConverter.cpp:596: error: expected primary-expression before ‘)’ token
Utils/OgreBulletCollisionsMeshToShapeConverter.cpp:602: error: ‘ConvexBuilder’ was not declared in this scope
Utils/OgreBulletCollisionsMeshToShapeConverter.cpp:602: error: expected `;' before ‘cb’
Utils/OgreBulletCollisionsMeshToShapeConverter.cpp:603: error: ‘cb’ was not declared in this scope
make[3]: *** [OgreBulletCollisionsMeshToShapeConverter.lo] Error 1
make[3]: Leaving directory `/home/EmileZola/Desktop/Ogre/ogrebullet/Collisions/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/EmileZola/Desktop/Ogre/ogrebullet/Collisions'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/EmileZola/Desktop/Ogre/ogrebullet'
make: *** [all] Error 2


I tried to add the include path to Extras/ConvexDecomposition via CXXFLAGS. Like here http://www.ogre3d.org/addonforums/viewtopic.php?f=12&t=9202

CXXFLAGS="-I/media/sda1/LIBRARIES/OGRE/ogre-v1-6-2/Samples/Common/include -I/media/sda1/LIBRARIES/PHYSICS/bullet-2.74/Extras/ConvexDecomposition" LDFLAGS="-L/media/sda1/LIBRARIES/PHYSICS/bullet-2.74/Extras -Wl,-rpath,/media/sda1/LIBRARIES/PHYSICS/bullet-2.74/Extras" LIBS="-lconvexdecomposition" ./configure


But then configure would not work...

EmileZola@gw-3:~/Desktop/Ogre/ogrebullet$ CXXFLAGS="-I/home/EmileZola/Desktop/Ogre/ogre_src_v1-7-1/Samples/Common/include -I/home/EmileZola/Desktop/Ogre/bullet-2.76/Extras/ConvexDecomposition" LDFLAGS="-L/home/EmileZola/Desktop/Ogre/bullet-2.76/Extras -Wl,-rpath,/home/EmileZola/Desktop/Ogre/bullet-2.76/Extras" LIBS="-lconvexdecomposition" ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for g++... g++
checking for C++ compiler default output file name...
configure: error: in `/home/EmileZola/Desktop/Ogre/ogrebullet':
configure: error: C++ compiler cannot create executables
See `config.log' for more details.

EmileZola

09-09-2010 17:09:31

Alright, found the problem looking in othe threads, and I thought it would be a good idea to post it all here...

The problem was with the ConvexBuilder lib. Run "make" in the /bullet-2.76/Extras/ConvexDecomposition folder.

Then type "sudo cp *.a /usr/lib/" to copy the libConvexDecomposition.a lib (notice the camel case).

After that, run "sudo ldconfig" to update your libs.

Then in OgreBullet dir...

./configure CXXFLAGS="-I/home/EmileZola/Desktop/Ogre/ogre_src_v1-7-1/Samples/Common/include -I/home/EmileZola/Desktop/Ogre/bullet-2.76/Extras/ConvexDecomposition" LDFLAGS="-L/home/EmileZola/Desktop/Ogre/bullet-2.76/Extras -Wl,-rpath,/home/EmileZola/Desktop/Ogre/bullet-2.76/Extras" LIBS="-lConvexDecomposition"


Notice the CaMelCaSe at the end...Then "make" and "sudo make install"

Everything worked fine !

Fish

09-09-2010 20:47:38

Nice find with the "#include <limits.h>"! It seems that MSVC includes limits.h automatically while gcc does not. I just verified that MinGW also needs limits.h specified.

edit: Fixed in SVN #2969

- Fish