OF and Bullet with ofxBullet

Hi forum,

I am trying to combine OF and Bullet physics engine using ofxBullet and i am having the following compilation error:

t/libs/bullet2.8.1/include/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolver_DX11.cpp
In file included from ../../../addons/ofxBullet/libs/bullet2.8.1/include/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolver_DX11.h:22:0,
                 from ../../../addons/ofxBullet/libs/bullet2.8.1/include/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolver_DX11.cpp:19:
../../../addons/ofxBullet/libs/bullet2.8.1/include/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolverVertexBuffer_DX11.h:22:21: fatal error: windows.h: No such file or directory
 #include <windows.h>
                     ^
compilation terminated.
make[1]: *** [../../../addons/obj/linux/Release/ofxBullet/libs/bullet2.8.1/include/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolver_DX11.o] Error 1

It points inside the bullet plugin that come along as an addon with the OF. Any hint to get around this issue?

Thanks

What platform are you trying to build for?
The libs are included in the VS and OSX projects. The source is compiled for the CodeBlocks projects. Does a clean and build work? Sometimes the projects can get corrupt and adding the appropriate files can fix the problem.

I am running Ubuntu 14.04 . I did run the make clean and then make , but the same error prevails.

What are those appropriate files that i might need to add ?

Let me know if i can provide you with any info that might solve the issue.

Thanks

The current version of ofxBullet has not been tested on Linux. I’m not familiar with Ubuntu, so I won’t be able to provide assistance as to why it’s not compiling properly. But if you are able to compile the current ofxBullet on linux, it would be great if you could help out with Linux support. :smile:

However, the previous version of ofxBullet should be compatible with Linux. https://github.com/NickHardeman/ofxBullet/releases

Hi @NickHardeman,

Thanks for the support. Let us try to make this issue a bit simpler to make it functional. Lets assume the fact that i am not using the bullet library that comes along with the plugin. Instead i have the library installed in my system from the very beginning.

Could you please guide me to alter the configuration file so that ofxBullet does not access the libs directory of the plugin. If you take another look into the error, you will see that it is coming from the libs directory. Do you not think that it would be better if you set the pre-requisite to the user that they have to have the bullet library installed into their system as the very same way we ask the to fulfill some of the pre-requisites before installing OF. I hope that i explained myself well enough.

Thanks

I think the lib should be included in the addon. So when the library gets updated the appropriate files will still be included in the addon. Windows support was added by compiling the source files with the vs project, which is different than the last ofxBullet version. Maybe the make file is pulling in the entire include directory and is throwing an error because it does not see a ‘<windows.h>’ file?

Hi @NickHardeman

I have managed make some changes within the addon to make it work within linux:

  1. I have installed bullet physics engine and the addon does not depend on the one that comes along.
  2. I have added one configuration file to make sure that compiler looks for the proper file inclusion and dynamic link
    from the within the system.
  3. It has been tested with the master branch of OF and it worked fine with one of the examples authored by you.

I just need some suggestions how to merge this issues into the existing one since there are some changes within the process i observed.

Thanks

Hi @sajjad,

This is great! :smile: Do you have instructions on how to get the correct bullet lib version installed?
What issues are you having with merging? Is it git related?

Hi @NickHardeman,

I have used the apt manager within Ubuntu to install the Bullet Physics Library. Then i added the file named addon_config.mk with the following contents and rest of the directory is a direct copy of the guide on how to create addons:

meta:
	ADDON_NAME = ofxBullet
	ADDON_DESCRIPTION = A wrapper for Bullet for openFrameworks
	ADDON_AUTHOR = Nick Hardeman
	ADDON_TAGS = "ofxBullet"
common:
linux:
	ADDON_LIBS =
	ADDON_CFLAGS = -I/usr/include/bullet
	ADDON_LDFLAGS = -lLinearMath -lBulletDynamics -lBulletCollision -lBulletFileLoader -lBulletSoftBody -lBulletWorldImporter -lBulletXmlWorldImporter 

The template of addon creation contains some reference to the static library , i had to delete them from the directory structure and then the linking was fine .

Ok, that makes sense. Can you send a git pull request so we can get it into the addon?