google-code-export / bullet

Automatically exported from code.google.com/p/bullet
0 stars 0 forks source link

Compile errors in btVector3.cpp #745

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Include LinearMath in Xcode project as well as other sources.
2. Compile
3. Get 4 compile errors.

What is the expected output? What do you see instead?
Successful compilation.

What version of the product are you using? On what operating system?
I'm using bullet-2.81-rev2613 on Mac OS 10.8.5 with Xcode 5. Following this 
tutorial on how to use Bullet with iOS
http://www.informit.com/articles/article.aspx?p=1914612&seqNum=2

Please provide any additional information below.
Here are errors I see:

Lines 46 & 431
46:     static const unsigned char indexTable[16] = {-1, 0, 1, 0, 2, 0, 1, 0, 
3, 0, 1, 0, 2, 0, 1, 0 };
431:   static const unsigned char indexTable[16] = {-1, 0, 1, 0, 2, 0, 1, 0, 3, 
0, 1, 0, 2, 0, 1, 0 };

../bullet-2.81-rev2613/src/LinearMath/btVector3.cpp:46:50: Constant expression 
evaluates to -1 which cannot be narrowed to type 'unsigned char'

Lines 58 & 443
58: memset( stack_array, -1, STACK_ARRAY_COUNT * sizeof(stack_array[0]) );
443: memset( stack_array, -1, STACK_ARRAY_COUNT * sizeof(stack_array[0]) );

../bullet-2.81-rev2613/src/LinearMath/btVector3.cpp:58:5: Use of undeclared 
identifier 'memset'

I've fixed them locally using explicit cast and including <memory>, but thought 
that it would be better if this could be fixed in main repo or stated somewhere 
how to get around those build errors.

Thanks for the work!

Original issue reported on code.google.com by kir...@pixeloxygen.com on 5 Oct 2013 at 10:11

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Hi,

Here is what I have. I only starting to review Bullet so there might be a
total mess in the project.

Please download everything here (~35Mb, since I don't know what to
remove). 
https://dl.dropboxusercontent.com/u/3945288/bullet-2.81-rev2613-issue745-te
st.zip

Inside the folder there is a project HelloBullet3D. Please note it DOES
compile, since I've made changes I mentioned in the issue, you can replace
code with original and then you'll get compilation errors.

Here is what I did.

1. Downloaded bullet-2.81-rev2613.tgz (Unix Line Endings)
2. Unpaked and used Cmake to configure and then generate Xcode project
(here is screenshoot http://screencast.com/t/W9Jt3QGl)
3. Then I've created my project within bullet-2.81-rev2613 folder since
this tutorial 
(http://www.informit.com/articles/article.aspx?p=1914612&seqNum=2) says
that there are some issues with relative and absolute paths, so it is
better to create project inside that folder.
4. My project is HelloBullet3D (it is a "Single View Application" iOS app
template created with Xcode 5)
5. Then I added required folders to project from src (BulletCollision,
BulletDynamics, LinearMath) and added search headers path.

Right after that I've compiled and got errors mentioned in issue.

Please let me know if I can help somehow. In fact it would be great to
have Xcode project template with Bullet (like it is with cocos2d + Box2d).

Original comment by kir...@pixeloxygen.com on 6 Oct 2013 at 7:31

GoogleCodeExporter commented 9 years ago

I cannot open your project, it has absolete folder in there.

Can you try the following, in a Mac OSX terminal window:

cd Bullet/build
./premake_osx --ios xcode4
open xcode4ios/0BulletSolution.xcworkspace

Here that compiles the source code without any error.
Are you using clang or gcc? Which version of the iOS SDK and which version of 
Xcode5?
Do Xcode/About, and tell what is in the brackets, for example Version 5.0 
(5A1413)

Original comment by erwin.coumans on 6 Oct 2013 at 8:27

GoogleCodeExporter commented 9 years ago
memset should be defined in <string.h>,which is included in btVector.cpp 
(whenever memset is used).

I cannot reproduce your issue, the source code just compiles fine.

Original comment by erwin.coumans on 19 Oct 2013 at 4:36

GoogleCodeExporter commented 9 years ago
Fixed in trunk
https://code.google.com/p/bullet/source/detail?r=2698

Original comment by erwin.coumans on 24 Oct 2013 at 12:23