Hi,
I started a project in XCode 3.2 and got Irrlicht 1.7.1 to work, thanks!
But in my project, I have to name all files with the extension .mm
How did you get XCode to accept .cpp files to compile C++ instead of Objective-C in the Irrlicht XCode project?
I already studied the project settings and googled, but found no solution. Since I want to share the code later for cross platform development, the .mm extension is not quite useable...
Can someone please help me?
Question on Programming for MacOSX
-
- Posts: 914
- Joined: Fri Aug 03, 2007 12:43 pm
- Location: South Africa
- Contact:
.m = Objective C code only
.mm = Objective C++ (Objc and C++ can be used together)
.cpp/cc = C++ code,
You can code as much c++ as you want to, and the compiler will know what to do with the file based on the extension. If you :Get Info: on the specific file, there is a build rules tab which can be used to override the option, but
It should work as is. How are you adding the files to the target/project. Make sure that when you add it, you make them part of the target you are building,
Search for the file in the top right area of XCode, and then make sure it has a little tick in the target column (it looks like a target).
.mm = Objective C++ (Objc and C++ can be used together)
.cpp/cc = C++ code,
You can code as much c++ as you want to, and the compiler will know what to do with the file based on the extension. If you :Get Info: on the specific file, there is a build rules tab which can be used to override the option, but
It should work as is. How are you adding the files to the target/project. Make sure that when you add it, you make them part of the target you are building,
Search for the file in the top right area of XCode, and then make sure it has a little tick in the target column (it looks like a target).
Hmm, thanks for the input FuzzYspo0N.
I checked this and the .cpp file info is sourcecode.cpp.cpp
The file is also part of the build target, but if I try to compile it, I get 1120 compiler errors (!) in NSObjCRuntime.h with symbols undefined, etc.
Strange thing is, this happens as soon as i put any .cpp file to my project, even an empty one. If i name the file to .mm or exclude it from build, it works.
Sure, i could live with .mm files but I'd like to understand that. Maybe can help me there?
I checked this and the .cpp file info is sourcecode.cpp.cpp
The file is also part of the build target, but if I try to compile it, I get 1120 compiler errors (!) in NSObjCRuntime.h with symbols undefined, etc.
Strange thing is, this happens as soon as i put any .cpp file to my project, even an empty one. If i name the file to .mm or exclude it from build, it works.
Sure, i could live with .mm files but I'd like to understand that. Maybe can help me there?
-
- Posts: 914
- Joined: Fri Aug 03, 2007 12:43 pm
- Location: South Africa
- Contact:
I checked for prefix settings, but they don't differ from those in Irrlicht's MacOSX project settings. There is also a MacOSX_Prefix.pch...
I also tried to change some of the settings and did "clean build" and "build" again, but only got more error messages (up to over 10.000 )
Well, next I'll try to get IrrODE to work on MacOSX. Maybe I get more insights then...
I also tried to change some of the settings and did "clean build" and "build" again, but only got more error messages (up to over 10.000 )
Well, next I'll try to get IrrODE to work on MacOSX. Maybe I get more insights then...
Ahhh, I found the solution in another Irrlicht thread
I didn't get what you meant with the prefix headers, but now I understand.
The apple default project settings include an Appkit.h precompiled prefix header and this must be disabled in the project settings!
Here is the link I found with the vital information:
http://karlkirch.com/blog/2010/03/10/bu ... xcode-3-2/
Thanks for the help, maybe I can make some progress on IrrODE on MacOSX now...
I didn't get what you meant with the prefix headers, but now I understand.
The apple default project settings include an Appkit.h precompiled prefix header and this must be disabled in the project settings!
Here is the link I found with the vital information:
http://karlkirch.com/blog/2010/03/10/bu ... xcode-3-2/
Thanks for the help, maybe I can make some progress on IrrODE on MacOSX now...
-
- Posts: 914
- Joined: Fri Aug 03, 2007 12:43 pm
- Location: South Africa
- Contact: