.CPP files using the SIO2.h include?
3 posters
.CPP files using the SIO2.h include?
Probably a silly question but this is all new to me ![Smile](https://2img.net/i/fa/i/smiles/icon_smile.gif)
I added a new .CPP file to my project and included "sio2.h" in that .CPP file but it will not compile. It compiles after renaming the file to .MM. My question is, must any source file using the SIO2 Engine use the .MM extension?
![Smile](https://2img.net/i/fa/i/smiles/icon_smile.gif)
I added a new .CPP file to my project and included "sio2.h" in that .CPP file but it will not compile. It compiles after renaming the file to .MM. My question is, must any source file using the SIO2 Engine use the .MM extension?
Cobbler- Posts : 15
Join date : 2009-02-01
Re: .CPP files using the SIO2.h include?
The question isn't stupid at all. I had to learn this stuff myself when I started using sio2:
Sio2 mixes objective c and c++ code, also known as "objective c++".
If the suffix of a file is .mm Xcode sets the file type automatically to sourcecode.cpp.objcpp.
But if you want to keep the suffix .cpp, you can tell Xcode manually to treat the file as an objective c++ source in the inspector.
That's how it's done for all the sio2 sources in the template projects for example.
I hope that answers your question.
Sio2 mixes objective c and c++ code, also known as "objective c++".
If the suffix of a file is .mm Xcode sets the file type automatically to sourcecode.cpp.objcpp.
But if you want to keep the suffix .cpp, you can tell Xcode manually to treat the file as an objective c++ source in the inspector.
That's how it's done for all the sio2 sources in the template projects for example.
I hope that answers your question.
Re: .CPP files using the SIO2.h include?
That makes sense but how do I tell XCode that .cpp should be treated as objective c++ files? I'm looking at Filer Types in XCode Preferences where I find
and all of them are set to Default (Source Code File). Am I looking in the wrong place?
- Code:
sourcecode
sourcecode.c
sourcecode.cpp
sourcecode.cpp.h
sourcecode.cpp.objcpp
sourcecode.cpp.cpp
and all of them are set to Default (Source Code File). Am I looking in the wrong place?
Cobbler- Posts : 15
Join date : 2009-02-01
Re: .CPP files using the SIO2.h include?
There might be a better way of doing this, but you can right click any file in XCode and "Get Info". It will open a dialog and on the "General" tab you will find a "File Type" pulldown menu. Select "sourcecode.cpp.objcpp".
With this method you can individually change "file types" of the files in XCode.
With this method you can individually change "file types" of the files in XCode.
zzajin- Posts : 81
Join date : 2008-10-14
Re: .CPP files using the SIO2.h include?
Thanks! That works but it is tedious so a better solution is welcome if anyone has one...
Cobbler- Posts : 15
Join date : 2009-02-01
Re: .CPP files using the SIO2.h include?
I should have thought about this before, but you can select multiple files thus setting the file types of them all at once.
zzajin- Posts : 81
Join date : 2008-10-14
![-](https://2img.net/i/empty.gif)
» Please provide Blender files
» resetting scenes, sio2 resource files, and multiple levels
» Request: glut+SIO2 project template with SIO2 releases.
» Compressed Textures from Apple's texturetool
» Error when using sound files
» resetting scenes, sio2 resource files, and multiple levels
» Request: glut+SIO2 project template with SIO2 releases.
» Compressed Textures from Apple's texturetool
» Error when using sound files
Permissions in this forum:
You cannot reply to topics in this forum