Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7552327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T10:44:00+00:00 2026-05-30T10:44:00+00:00

I am experiencing either an extremely weird error or a temporary loss of brain

  • 0

I am experiencing either an extremely weird error or a temporary loss of brain function.

I have a box2d / cocos project running in XCode. This all works fine but my code is currently a proof of concept “hack”. Stage one of cleaning up the code is creating classes for various objects.

Now, if I create a brand new Objective C class (inherited off NSObject) as below it all compiles fine. As soon as I attempt to import the “Box2D.h” I receive a gazillion errors originating from the box2d library saying it cannot be built. 201 to be precise and it indicates no issues with the class itself. Can anyone shed any light? I have already tried a clean and rebuild as well as restarting XCode.

My super complicated class definition

#import "Box2D.h"

@interface test : NSObject

@end

An example compiler error thrown

Expected '=', ',', ';', 'asm' or '__attribute__' before 'b2Fixture' in /Users/..../libs/Box2D/Dynamics/b2Body.h
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T10:44:01+00:00Added an answer on May 30, 2026 at 10:44 am

    You need an Objective-C++ file for this, because Box2D is written in C++ and thus doesn’t compile in Objective-C out of the box. Luckily, its just a matter of renaming your file from myClass.m to myClass.mm

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am experiencing strange log cat behaviour in my app, either I have two
I'm experiencing an issue on a test machine running Red Hat Linux (kernel version
I'm experiencing a weird situation with deleting files in Ruby, the code seems to
I'm experiencing extremely slow query execution when linking records on foreign keys. For instance
I'm experiencing an error that I haven't been able to find any mention of
I'm experiencing some strange behavior with a project i'm working on: http://daft.net76.net/yah/ When you
I'm experiencing a weird issue with my sphinx setup in my staging environment where
A small number of our users are experiencing an error when they try to
I am experiencing problems when running some code that I am developing. It should
I've resolved an error some of my users were experiencing whenever my app loads

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.