Xcode... addons... Box2D... compile error.


I’m new to C++ and OF , but got a good experience in php and python. So I’m not really use to compiler.

I dowloaded the FAT package and played with all the exemples without problem. The next step for me was to try creating a project with a new addon. I choosed ofxBox2d because it simply look awesome.

Here’s the step I took in Xcode.

  1. I added a new group to my project name ‘addons’
  2. I added ‘Existing Files’ to this group and selected the ofxBox2d folder. A window promt with some options (reference type, text encoding, etc.) I accepted the default options.
  3. Repeated the same steps for ofxVectorMath.
  4. I then try to compile without changing anything in my emptyExample code, then I got those errors:

ps. I only get the error when I try adding the ofxBox2d addons.

Thanks a lot for your time!

Hey plehoux!

You have to remove the example folder of the imported ofxbox2d addon, because there’s a second main.cpp (That’s what the linker is trying to say: duplicate symbol _main). That should do the trick.


Tks a lot!

I was getting closer… I knew I had to main() … tks for the help!