PDA

View Full Version : Odd Xcode Error




Blakeasd
Jun 28, 2011, 01:32 PM
I am getting a strange Xcode error, and I don't know why.
This is the error I'm getting:
http://i1107.photobucket.com/albums/h386/Blakeasd/ScreenShot2011-06-28at22942PM.png

The file it says I don't have is in my Xcode project as you can see from this screenshot:
http://i1107.photobucket.com/albums/h386/Blakeasd/ScreenShot2011-06-28at23027PM.png

Why is this happening?? I am looking at the .h file right now :confused:



lloyddean
Jun 28, 2011, 02:11 PM
And if you change -

#include <Box2D/common/b2Settings.h>

to -

#include "Box2D/common/b2Settings.h"

mydogisbox
Jun 28, 2011, 02:19 PM
What are the folder structure and the project name?

Blakeasd
Jun 28, 2011, 02:50 PM
@lloydean, I get the same error. This is pre-written code that came with the Cocos2dBox2d Mac template.
@mydogisbox What do you mean by folder structure?

jiminaus
Jun 28, 2011, 04:26 PM
The fact the your looking at b2Settings.h just provides that it exists.
Where does it actually sit in your filesystem?

Blakeasd
Jun 28, 2011, 04:52 PM
/Users/blake/Desktop/Penguin Quest/Penguin Quest/b2Settings.h
(Penguin Quest is the name of my app)

Blakeasd
Jun 28, 2011, 05:10 PM
I changed the #included statement to this

#include <b2Settings.h>

and I don't get an error anymore. Will this cause me problems along the way or did I fix the issue?

jiminaus
Jun 28, 2011, 05:10 PM
/Users/blake/Desktop/Penguin Quest/Penguin Quest/b2Settings.h
(Penguin Quest is the name of my app)

Then how do you expect Box2D/common/b2Settings.h to find that?! There's no Box2D folder, no common folder.

Assuming b2Settings.h doesn't include other files itself presuming it's in the common subfolder of the Box2D folder.

#include "b2Settings.h"

Blakeasd
Jun 28, 2011, 05:12 PM
Thanks!
I think we posted at the same time. :)

jiminaus
Jun 28, 2011, 05:25 PM
I changed the #included statement to this

#include <b2Settings.h>

and I don't get an error anymore. Will this cause me problems along the way or did I fix the issue?

It's wrong to use <> here. It's correct to use "". They are different.

#include <blah.h> is the correct way to access header files on the system header file search path, including header files in linked frameworks.

#include "blah.h" is the correct way to access header files local to your project.

Although you didn't code b2Settings.h, it is local to your project, so it's correct to use "".

XCode3 has the "Always search user paths" build setting set to true by default, so the mistake of using <> instead of "" isn't flagged as an error. That build setting is evil. XCode4 has the build setting set to false by default.

Blakeasd
Jun 28, 2011, 06:06 PM
I am having yet another darn Xcode error:
"Ignoring file /Developer/SDKs/MacOSX10.6.sdk/Library/Frameworks//OpenAL.framework, file was built for unsupported file format which is not the architecture being linked (x86_64)"

This is driving me CRAZY, I've spent at least an hour correcting the include lines and now this weird error!

Can you please help? Whoever wrote this template is trying to drive me crazy I think :confused:

Blakeasd
Jul 2, 2011, 02:19 PM
I am having issues with Box2d. Here is the error:
http://i1107.photobucket.com/albums/h386/Blakeasd/ScreenShot2011-06-28at22942PM.png
As you can see the file exists and it IS in the right spot.
http://i1107.photobucket.com/albums/h386/Blakeasd/ScreenShot2011-07-02at31713PM.png


What's going on?! :confused: I think it has to do with the <> and maybe it should be "", but how can I just get the <>s to work because there are probably 1,000 of these includes.
Thanks

jiminaus
Jul 2, 2011, 07:51 PM
I am having issues with Box2d. Here is the error:
Image (http://i1107.photobucket.com/albums/h386/Blakeasd/ScreenShot2011-06-28at22942PM.png)
As you can see the file exists and it IS in the right spot.
Image (http://i1107.photobucket.com/albums/h386/Blakeasd/ScreenShot2011-07-02at31713PM.png)


What's going on?! :confused: I think it has to do with the <> and maybe it should be "", but how can I just get the <>s to work because there are probably 1,000 of these includes.
Thanks

Now that you have the full and property file hierarchy for Box2D, you indeed need to use <> instead "". Add the path to the Supporting Files directory to your project's or target's header search paths build setting.

Blakeasd
Jul 2, 2011, 08:02 PM
Ah!
Thanks