include files in Xcode
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
/sw/include/libpng12
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:
Macintosh HD/sw/include/libpng12/png.h
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" ?
thanks.

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
/sw/include/libpng12
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:
Macintosh HD/sw/include/libpng12/png.h
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" ?
thanks.
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.
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.
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.
Did you ever wonder why we had to run for shelter when the promise of a brave new world unfurled beneath the clear blue sky?
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?
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?
Now Xcode can't find definitions for my first png function: readpng_init(__sFile*,
long*, long*)
I put
/sw/bin
/sw/sbin
/sw/lib
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
definitions reside?
long*, long*)
I put
/sw/bin
/sw/sbin
/sw/lib
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
definitions reside?
Did you include -lpng in your link options?
Did you ever wonder why we had to run for shelter when the promise of a brave new world unfurled beneath the clear blue sky?
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.
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.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| StorageRoom - Include content in your games | sashthebash | 0 | 2,087 |
Jun 13, 2011 05:39 AM Last Post: sashthebash |
|
| Why won't Xcode even try compiling my .cpp files?? | SparkyNZ | 11 | 11,043 |
Apr 3, 2011 01:44 PM Last Post: AnotherJake |
|
| #include <ft2build.h> | BBBert | 4 | 9,898 |
Apr 7, 2008 09:33 AM Last Post: BBBert |
|
| Newbie problem XCode Include files | BBBert | 1 | 3,816 |
Mar 17, 2008 03:46 PM Last Post: OneSadCookie |
|
| .C cplusplus files in XCode? | kelvin | 2 | 3,500 |
Mar 27, 2007 04:18 PM Last Post: OneSadCookie |
|

