Creating a project from scratch

From Physics Simulation Wiki

(Difference between revisions)
Jump to: navigation, search
(Creating a project from scratch using Visual Studio)
(Creating a project from scratch using Visual Studio 2008: comment about how to build and run BasicDemo)
Line 11: Line 11:
** In Configuration Properties > Linker > Input > Ignore Specific Libraries add <tt>LIBC,LIBCD,LIBCMTD</tt>
** In Configuration Properties > Linker > Input > Ignore Specific Libraries add <tt>LIBC,LIBCD,LIBCMTD</tt>
* Build and debug your project.
* Build and debug your project.
 +
 +
Note: You can also add the files of the BasicDemo (see <tt>C:\bullet-2.75\Demos\BasicDemo\</tt>: <tt>main.cpp</tt>, <tt>BasicDemo.cpp</tt>, and <tt>BasicDemo.h</tt>) to your project and build the demo. To run it, make sure to copy <tt>C:\bullet-2.75\GLUT32.DLL</tt> into the directory of the built executable.
=Creating a project from scratch using XCode  =
=Creating a project from scratch using XCode  =

Revision as of 14:43, 15 January 2010

Creating a project from scratch using Visual Studio 2008

I'm assuming you have installed Bullet in C:\bullet-2.75\. Adjust all pathnames if necessary.

  • Create a new, empty C++ project (File > New > Project: Choose Project types > Visual C++ > General > Empty Project)
  • Add a new C++ file (e.g. "main.cpp") to your project and copy the code from the Hello World page into it and save it.
  • Open the properties of your project (in the Solution Explorer right-click the project name and select Properties, or in the Property Manager double-click Debug|Win32):
    • In Configuration Properties > C/C++ > General > Additional Include Directories add: C:\bullet-2.75\src;C:\bullet-2.75\Glut;C:\bullet-2.75\Demos\OpenGL;C:\bullet-2.75\Extras\ConvexHull
    • In Configuration Properties > C/C++ > Preprocessor > Preprocessor Definitions add: _DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32
    • In Configuration Properties > Linker > General > Additional Library Directories add: C:\bullet-2.75\Glut;C:\bullet-2.75\out\debug8\libs
    • In Configuration Properties > Linker > Input > Additional Dependencies add glut32.lib libBulletColladaConverter_d.lib libbulletcollision_d.lib libbulletdynamics_d.lib libbulletmath_d.lib libbulletmultithreaded_d.lib libbulletopenglsupport_d.lib libbulletsoftbody_d.lib libcolladadom_d.lib libconvexdecomposition_d.lib libGIMPACTUtils_d.lib libglui_d.lib libiff_d.lib liblibxml_d.lib (or any subset that is actually needed)
    • In Configuration Properties > Linker > Input > Ignore Specific Libraries add LIBC,LIBCD,LIBCMTD
  • Build and debug your project.

Note: You can also add the files of the BasicDemo (see C:\bullet-2.75\Demos\BasicDemo\: main.cpp, BasicDemo.cpp, and BasicDemo.h) to your project and build the demo. To run it, make sure to copy C:\bullet-2.75\GLUT32.DLL into the directory of the built executable.

Creating a project from scratch using XCode

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.72

  • Create a new C++ console application, using XCode:

Image:newxcodeproject.png

  • put it in next to bullet-2.x, in the develop folder:

Image:developfolder.png

  • Open the main.cpp file and add #include "btBulletDynamicsCommon.h":

Image:addcommoninclude.png

  • Edit the project settings for All Configurations

Image:editxcodeprojectsettings.png

  • Add the bullet-2.x/src folder:

Image:addbulletsrcinclude.png Image:addbulletsrcinclude1.png

  • Now build the project:

Image:buildxcode.png From here, continue to the Hello World tutorial.

Personal tools