Creating a project from scratch

From Physics Simulation Wiki

Revision as of 22:15, 25 January 2010 by Erwin coumans (Talk | contribs)
Jump to: navigation, search

Creating a project from scratch using Visual Studio 2008

  • The recommended way to start a new project from scratch is using cmake. Just have a look at the Bullet/Demos/HelloWorld/CMakeLists.txt.

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:

  • 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
  • Recursively add all .cpp files from the Bullet/src folder to your project
  • Build and debug your project.

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