大佬教程收集整理的这篇文章主要介绍了Bullet cocos2d-x Creating a project from scratch,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
Contents[hide] |
If you do not want to use cmake,here is another simple method. Assuming you have unzipped Bullet in C:\bullet-2.75\,adjust all pathnames if necessary:
highlight: Unknown source file extension "dos".
You need to specify a language like this: <source lang="html">...</source>
Supported languages for syntax highlighTing:
4gl,a4c,abp, ada,agda,ampl,amtrix,applescript,arc,arm,as,asm,asp,aspect,au3,avenue,awk, bat,bb,bib,bms,boo,c,cb,cfc,clipper,clp,cob,cs,css,d,diff,dot,dylan,e,erl,euphoria,exp,f77,f90,flx,frink,haskell,hcl,httpd,icn, idl,ini,inp,io,j, java,js,jsp,lbn,ldif,lgt,lisp,lotos,ls,lsl,lua,ly,@H_716_211@m,@H_716_211@make,@H_716_211@mel,@H_716_211@mib,@H_716_211@miranda,@H_716_211@ml,@H_716_211@mo,@H_716_211@mod3,@H_716_211@mpl,@H_716_211@ms,@H_716_211@mssql,n,nas,nice,nsi,nut,oberon, objc,octave,oorexx,os,pas,php,pike,pl,pl1,pov,pro,progress,ps,ps1, psl,py,pyx,q,qu, r,rb,rexx,rnc,s, sas,sc,scala,scilab,sh,sma,smalltalk,sml,snobol, spec,spn,sql,sybase,tcl,tcsh,test_re,tex,ttcn3, txt,vb,verilog,vhd,xml,xpp,y
Assume we downloaded bullet-2.x.tgz and unzipped it into a folder /Users/name/develop,we will have for example: /Users/name/develop/bullet-2.76
"btTypedConsTraint::serialize(void*,btserializer*) const",referenced from:
"btAlignedFreeInternal(void*)",referenced from:
then you have to include the Bullet frameworks in your Xcode project. Make sure they are built and installed like this (This is without Xcode,maybe there is some way to make them in Xcode too,I don't know):
cmake . -G "Unix Makefiles" -DINSTall_LIBS=ON -DBUILD_SHARED_LIBS=ON \ -DFRAMEWORK=ON -DCMAKE_OSX_ARCHITECTURES='i386;x86_64' \ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTall_PREFIX=/Library/Frameworks \ -DCMAKE_INSTall_NAME_DIR=/Library/Frameworks -DBUILD_DEMOS:BOOL=OFF make -j4 sudo make install
This will put the Bullet frameworks in /Library/Frameworks. Navigate there in the finder and then drag the frameworks into your Xcode project. You need at least LinearMath.framework and BulletDynamics.framework. (Those two will fix the above linking errors.) But you probably also want BulletCollision.framework and maybe others.
If you have set up the frameworks like this,you don't have to change the header search path as above. Instead you can put this include line and Xcode will find the headers inside the framework:
#include <BulletDynamics/btBulletDynamicsCommon.h>
Follow the generic make recipe from the installation guide making sure the .a files are built. From there,when creaTing a Makefile,in the gcc arguments,make sure you add in a -I bullet_dir for the headers and also add in libBulletDynamics.a,libBulletCollision.a and libLinearMath.a or whatever you're using.
For example (assuming the src dir is in the folder bullet):
gcc myprogram.cpp -lGL -lGLU -I ./bullet/ ./bullet/BulletDynamics/libBulletDynamics.a ./bullet/BulletCollision/libBulletCollision.a ./bullet/LinearMath/libLinearMath.a
Note that many compilers the link order matters,so make sure to use the following order of libraries:
以上是大佬教程为你收集整理的Bullet cocos2d-x Creating a project from scratch全部内容,希望文章能够帮你解决Bullet cocos2d-x Creating a project from scratch所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。