Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Adding Objective C++ File?

Author
Message
Willie Mundermuffin
18
Years of Service
User Offline
Joined: 5th Jan 2006
Location:
Posted: 14th Jan 2013 11:53 Edited at: 14th Jan 2013 12:23
I'm not sure what's going on here. I recently switched my hard drive out for a new solid state drive and reinstalled and updated xcode, etc. Before this, everything worked perfect, but now when I try to Add New File, the objective c++ file type is nowhere to be found?? There is an add Objective C Class type, which adds an .m extension, but no option for .mm. Anyone know what's going on? Thank you!

*EDIT: Now I'm even more confused! I manually changed the file extension to .mm and it immediately broke the build, giving me compiler errors, saying it expects a semicolon at the end of the signatures (implementations, not declarations) for my class methods in the .mm file. What the heck?!? Everything worked perfectly before I reinstalled everything!
Willie Mundermuffin
18
Years of Service
User Offline
Joined: 5th Jan 2006
Location:
Posted: 14th Jan 2013 12:31
I just realized the iOS 6.0 and Xcode 4.5 Developer Library haven't finished downloading. Could this possibly be the cause? I'm pretty sure Objective C++ was available before 4.5, but who knows...
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 14th Jan 2013 15:13
Quote: "giving me compiler errors, saying it expects a semicolon at the end of the signatures (implementations, not declarations) for my class methods in the .mm file"


If you click on the file and check the far right pane (you may have to click the button in the top right to show this pane) it will have a source type field. This should read Objective C++ source, otherwise it will complain about objective C. You can mark any file extension as objective C, we do this with .cpp files so they will compile when including objective C files.
Willie Mundermuffin
18
Years of Service
User Offline
Joined: 5th Jan 2006
Location:
Posted: 15th Jan 2013 06:20 Edited at: 15th Jan 2013 06:34
So, basically file extension doesn't really mean much. The compiler relies on the File Type field says? So, basically, I could just create regular C++ files and then mark them as Objective C++ in the file property editor and it'll work fine?

*EDIT: Tried it out and worked! Thanks a lot! Still, I wonder why it isn't showing in New File anymore? Weird...

Login to post a reply

Server time is: 2024-05-03 23:17:49
Your offset time is: 2024-05-03 23:17:49