include files in Xcode - Printable Version
+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Tools & Technology (/forum-10.html)
+--- Thread: include files in Xcode (/thread-5389.html)
include files in Xcode - WhatMeWorry - Jun 21, 2005 01:17 PM
Another stupid question, but please, humiliate me.
I'm getting rid of my Targa files in my old OS 9 application and I'm trying to
move over to PNG files. I went into fink and downloaded the libpng3 package.
In my Xcode project main.cpp file, I inserted a #include <png.h>
The compiler keeps complaining about not finding png.h file. So,
I went into
Project Info -> Collection -> Header Search Paths and entered
But the compiler is still not finding png.h Is /sw/include/libpng12 the "real"
path. I noticed in the Finder, the path for png.h shows:
Should I be including the Hard Drive in my paths or is it ignored? If so,
what string does Macintosh HD become? Is it "Macintosh_HD" ?
include files in Xcode - Dan Potter - Jun 21, 2005 01:49 PM
You've got to be careful with your path conventions. The Finder path is actually "Macintosh HD:sw:include:libpng12:png.h". The Unix path is "/sw/include/libpng12/png.h". The latter is the only important one for dealing with Xcode.
I think to get it to use your include path, you'll actually have to put that in a build setting. Also it probably should be /sw/include, right? If this is Fink you're dealing with.
include files in Xcode - Steven - Jun 21, 2005 05:51 PM
I believe that png.h should be in /sw/include, with it including various files in the /sw/include/libpng12 by itself. Try Dan's suggestion.
include files in Xcode - WhatMeWorry - Jun 21, 2005 07:49 PM
Yes, you are correct. The png.h is in the /sw/include directory.
However, the this stupid programmer (random typist) forgot to put a
# before the include.
Say, noticed that in the Target "MyProject" Info screen, the Header Search Paths
was stuck through with a line. Does anybody know why? Is this because a Header
Search Path was defined in the Project "MyProject" Info screen?
include files in Xcode - WhatMeWorry - Jun 21, 2005 08:30 PM
Now Xcode can't find definitions for my first png function: readpng_init(__sFile*,
in the Library Search Paths of info page. I've been perusing within
all the folders under sw, but how can I tell where all the png function
include files in Xcode - Steven - Jun 22, 2005 01:00 PM
Did you include -lpng in your link options?
include files in Xcode - WhatMeWorry - Jun 22, 2005 06:07 PM
No. But I'm trying now. There appears to be (Using the File->Get Info command)
link settings under the Project and Target. I put -lpng in "Other Linker Flags" field
of the Project. When I went to the Target linker screen, the Other Link Flags was
struck through with a line.
I re-compiled and this time I got a "can't open: -lpng (no such file or directory).
Guess that wasn't the right place. But all the other linking "settings" don't seem to
make much sense: Library Routine, Prebinding, ZeroLink, Exported Symbols File... etc.