4

I'm attempting to use XML (Chapter 10 in Professional iPhone and iPad Database Application Programming), and I've run into a bit of trouble.

Under Header Search Paths in Build Settings I have this path:
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/include/libxml2/

That's all fine and well, but then:

#import <libxml/parser.h> #import <libxml/tree.h> error: libxml/parser.h: No such file or directory 

If I flip the imports:

#import <libxml/tree.h> #import <libxml/parser.h> error: libxml/tree.h: No such file or directory 

Weird.

For now I have this:

#import <libxml/catalog.h> // Dirty hack #import <libxml/parser.h> #import <libxml/tree.h> error: libxml/catalog.h: No such file or directory 

But that's no good for a production app.

9
  • 1
    Down-voting because I want the question removed. Real nice. Commented May 12, 2011 at 16:48
  • 2
    You can flag the question and ask that it be removed. You do not have to pollute it with "DELETE BLA BLA" Commented May 12, 2011 at 16:50
  • 1
    @Thromordyn: You can remove your own questions. Generally, questions are left up, unless they violate the rules, or are jibberish. Commented May 12, 2011 at 16:51
  • @Joe Philllips Yes, that option is available, but it didn't get me anywhere. (But then, I did only click "Submit" two weeks ago.) I was just trying another angle. Sorry for offending? Commented May 12, 2011 at 16:53
  • 2
    Add a new answer with your solution (rebooting) and mark it as the answer. I don't see a reason for deleting this. It's a perfectly fine question Commented May 12, 2011 at 16:54

2 Answers 2

14

Try changing your header search path to ${SDK_DIR}/usr/include/libxml2.

Sign up to request clarification or add additional context in comments.

6 Comments

@Joe Why would that make a difference, though? Upgrading is made a bit easier, but doesn't that path point to the same place? // Edit: Yes it does. Xcode automatically replaced ${SDK_DIR} with what I entered originally. Less time to type, but as I guessed, it is exactly the same.
@Thromordyn ya that is strange behavior. You say it is a Dirty Hack because it just does not like your first libxml import correct? So is it compiling just fine when you add a useless include first like catalog.h
@Joe The first import is broken, so if I import a pointless file first and let it fail, the other two don't have any trouble. It's "dirty" because it doesn't actually fix the problem, it just lets everything else run. Or something like that. I do plan on having 0 errors if I can figure out how.
Thats why I am asking if it is compiling. You are saying that it is a hack so it makes it seem like it compiles but you say it generates an error which make me thinks that it does not compile. And also have you looked inside the folder at /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/usr/include/libxml2/libxml/ and make sure the headers are there?
I added that comment before I was done figuring things out. Eheh. Build is successful and there are no problems while running. (The app is pretty simple at this point, but everything looks okay.) // I guess I should have said something before, but I checked .../libxml/, and everything is there. (If it wasn't, I'd be having a slightly different bit of trouble.)
|
5

As it turns out, it was a trivial fix. I closed the project to work on another, and when I reopened it, the error was gone. Not exactly what I would have expected, but hey, it works now.

"When in doubt, reboot."

2 Comments

Plus 1 for the reboot tip :D
dumb answer that doesn't solve the problem. Right answer is to add ${SDK_DIR}/usr/include/libxml2 to your header search path. add another line below your existing search path

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.