Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demo project fails to build #2

Closed
MartinW opened this issue Sep 6, 2009 · 33 comments
Closed

Demo project fails to build #2

MartinW opened this issue Sep 6, 2009 · 33 comments

Comments

@MartinW
Copy link

MartinW commented Sep 6, 2009

Demo project builds with errors since upgrading to Snow Leopard and iPhone SDK 3.0. When building to SDK 2.2.1 Simulator gives 20 errors relating to error: libxml/xmlreader.h: No such file or directory. When building to SDK 3.0 Simulator gives 140 errors relating to error: libxml/xmlreader.h: No such file or directory.

Have I lost a reference when upgrading?

Thanks
Martin

@bengottlieb
Copy link
Owner

It sounds like your project got tweaked somewhere. You need to make sure that "Header Search Paths" in your Project Build Settings includes "/usr/include/libxml2/", recursively.

@MartinW
Copy link
Author

MartinW commented Sep 6, 2009

Upgraded to Xcode 3.2 with Snow Leopard iPhone SDK. All working OK. Thanks.

@mwaterfall
Copy link

I'm having the same problem. I'm running Xcode 3.2 under the Snow Leopard iPhone SDK, Simulator OS 3.1, and I've added "/usr/include/libxml2/" recursively to the projects build header search paths. I've cleaned and built it but I'm getting 20 errors relating to the libxml.

Libxml/xmlreader.h: No such file or directory

Hope someone can help, can't wait to get this working!

@bengottlieb
Copy link
Owner

Make sure you've got your Header Search Paths entered correctly (compare yours with the demo project, Target Info > Build > Header Search Paths)

@olamm2k
Copy link

olamm2k commented Feb 7, 2010

Hi,

Had the same issue here after doing an in-place upgrade from Leopard to Snow Leopard - i.e. /usr/include is pretty much empty. To amend this in XCode, double-click the target in the Demo Project and change the Header Search Paths variable from '/usr/include/libxml2' to '$(SDKROOT)/usr/include/libxml2'.

Check out http://bit.ly/iPhoneValentine - hopefully, soon to be including Twitter + OAuth with this nice library!

Oliver

@bengottlieb
Copy link
Owner

Oliver, thanks for the tip, I'll change this in the code!

Ben

@olamm2k
Copy link

olamm2k commented Feb 8, 2010

No problem at all - after all the help you give on StackOverflow, it's the least I can do!

Oliver

@ldjpr
Copy link

ldjpr commented Apr 7, 2010

Hello

I have the same problem. 140 errors with lots of :Libxml/xmlreader.h: No such file or directory" I have done the the setting of the header path as recommended with $(SDKROOT)/usr/include/libxml2. I set this in targets and in the top of the groups and files. Is it possible that I really dont have installed the lib in my OS? I am running Snow Leopard and using SDK 3.1.3. Any help on this will be highly appreciated. Exited to start using this create lib.

thanks

Les

@bengottlieb
Copy link
Owner

Les, Are you building the included demo, or your own project?

@ldjpr
Copy link

ldjpr commented Apr 8, 2010

Hi Ben

I used the included demo in the package, OAuthTwitterDemo.

Les

@bengottlieb
Copy link
Owner

You've verified that you have the appropriate header files in the location noted above?

@ldjpr
Copy link

ldjpr commented Apr 8, 2010

I have done a search in the HD and I dont have the header files. Do I need to download and install a dependency lib or is this suppose to be inside the demo package? If I need to install something what it is or where can I find more info.

Thanks again

Les

@ldjpr
Copy link

ldjpr commented Apr 8, 2010

Ok some progress!! Now is finding the lib and the list of errors reduced to 8. Now I am looking at something like this:
ld: warning: in /bengottlieb-Twitter-OAuth-iPhone-da7ccad/Twitter+OAuth/Libraries & Headers/libxml2.2.7.3.dylib, missing required architecture arm in file
Undefined symbols:
"_xmlTextReaderNodeType", referenced from:
-[MGTwitterLibXMLParser _nodeValue] in MGTwitterLibXMLParser.o
-[MGTwitterLibXMLParser _nodeValue] in MGTwitterLibXMLParser.o

"_xmlTextReaderRead", referenced from:
-[MGTwitterLibXMLParser _nodeValue] in MGTwitterLibXMLParser.o
-[MGTwitterLibXMLParser _statusDictionaryForNodeWithName:] in MGTwitterLibXMLParser.o

"_xmlTextReaderIsEmptyElement", referenced from:
-[MGTwitterLibXMLParser _nodeValue] in MGTwitterLibXMLParser.o
-[MGTwitterLibXMLParser _statusDictionaryForNodeWithName:] in MGTwitterLibXMLParser.o
-[MGTwitterLibXMLParser _userDictionaryForNodeWithName:] in MGTwitterLibXMLParser.o
-[MGTwitterLibXMLParser _hashDictionaryForNodeWithName:] in MGTwitterLibXMLParser.o
-[MGTwitterMessagesLibXMLParser _directMessageDictionaryForNodeWithName:] in MGTwitterMessagesLibXMLParser.o
"_xmlTextReaderConstName", referenced from:
-[MGTwitterLibXMLParser _statusDictionaryForNodeWithName:] in MGTwitterLibXMLParser.o

"_xmlFree", referenced from:
_xmlFree$non_lazy_ptr in MGTwitterLibXMLParser.o
"_xmlStrEqual", referenced from:
-[MGTwitterLibXMLParser _statusDictionaryForNodeWithName:] in MGTwitterLibXMLParser.o
-[MGTwitterLibXMLParser _statusDictionaryForNodeWithName:] in MGTwitterLibXMLParser.o

"_xmlTextReaderValue", referenced from:
-[MGTwitterLibXMLParser _nodeValue] in MGTwitterLibXMLParser.o
"_xmlReaderForMemory", referenced from:
-[MGTwitterLibXMLParser initWithXML:delegate:connectionIdentifier:requestType:responseType:URL:] in MGTwitterLibXMLParser.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

Any ideas?

Thanks

Les

@bengottlieb
Copy link
Owner

Make sure you've added libXml to your current target.

@ldjpr
Copy link

ldjpr commented Apr 8, 2010

I added to the header search path. Is that what you mean?

@bengottlieb
Copy link
Owner

no, you need to add the library (just like frameworks are added). Go to Target Settings, the General Tab, and click the "+" under Linked Libraries. See the Xcode docs for more info.

@ldjpr
Copy link

ldjpr commented Apr 8, 2010

Ok I understand now. Sorry but as you can see this is my first time using a 3rd party lib.
t
hanks

@ldjpr
Copy link

ldjpr commented Apr 8, 2010

That was it! Thanks. Now I can experiment with it.

Thanks for your availability and I hope this helps other newbies like me.

Les

@ajdavis
Copy link

ajdavis commented May 11, 2010

I'm in the same boat - at the top of MGTwitterLibXMLParser.h in this project, XCode shows the error:

/Users/ajdavis/resale/resale_app/Classes/ThirdParty/Twitter+OAuth/MGTwitterEngine/MGTwitterLibXMLParser.h:10:30: error: libxml/xmlreader.h: No such file or directory

I have "$(SDKROOT)/usr/include/libxml2" in my Header Search Paths, marked "recursive". I'm on XCode 3.2.2 on Leopard.

@ajdavis
Copy link

ajdavis commented May 12, 2010

Good GOD, that was not easy.

After some hours, I still haven't figured out how to set the header search path in my project to include libxml/xmlreader.h. I started a new project and set the header search path to /usr/include/libxml2, which works for including <libxml/xmlreader.h>. So it must be something wrong with this particular project, which I started from the Three20 template. Shrug.

What really works is just deleting from the project all the .h and .m files from MGTwitterEngine which rely on libxml -- you don't need them (it's an optional speedup to use them), and you can get the project to compile that way.

@ldjpr
Copy link

ldjpr commented May 12, 2010

ajdavis:

If you still want to use the libxml, this is how it worked for me

  1. Include the libxml2.dylib into the frameworks.
    • right click on frameworks on the project
    • add exiting framework and look for libxml2
    • once added you should see it in the list of frameworks
  2. Add header search path
    • go to build section of the project and look for Header Search Paths
    • Add $(SDKROOT)/usr/include/libxml2
  3. Clean all targets
  4. Close Xcode
  5. Delete build folder
  6. Open xCode and build

I spend a lot of time on this in order to solve it so I feel your pain, Let me know if its works and if not I will try to continue to help you.

Leslie

@husmukh
Copy link

husmukh commented Jun 11, 2010

Thanks Leslie .. ... I resolved issue within minutes with help of u r last post.

@ldjpr
Copy link

ldjpr commented Jun 11, 2010

Husmukh

You are welcome. It makes me happy to hear that all my invested hours someone can benefit from.

Leslie

@prabh
Copy link

prabh commented Jul 8, 2010

Hi Leslie,

I am using the FACEBOOK's API too along with TWITTER's so becasue of the same I have to set multiple header paths. I am getting 137errors in here. Can you help me out?

Thanks in advance.

Regards,
Prabh

@ldjpr
Copy link

ldjpr commented Jul 8, 2010

Sure I can try to help you out. Follow the steps I set before. This will solve the problem of dependency of libxml2.dylib. You can apply the same procedure for any other error of dylib used in FB's project but in this case you will need to know the name of the lib that you need to include in the project.

Leslie

@lionfly
Copy link

lionfly commented Sep 23, 2010

When the MGTwitterXMLParser.h is without the , do you guys get warnings (I get 5 warnings). When I changed it as follows, the warnings are gone.

@interface MGTwitterXMLParser : NSObject {

But I feel not comfortable making changes to the MGTwitterEngine files itself, which should be working without warnings for you guys? Will the I added make any possible problems?

Gary

@bengottlieb
Copy link
Owner

You don't need to worry about this; the compiler is just a little picker under 4.0. I'll update this one of these days, but for now, it's just annoying, not a real problem.

@lionfly
Copy link

lionfly commented Sep 24, 2010

I have passed the authentication step, and the app can send Tweets successfully. But there is no dialogue view for the user to confirm what to Tweet. I want to have a Twitter-background view similar to "SA_OAuthTwitterController" without the credential stuff, but with a textField for the user to edit preset text before sending the Tweet. I do not want to make a plain view without the Twitter-feel.

Does such a view already exist in the engine? Any recommendations?

Gary

@romulusx
Copy link

One other item of note to go along with Leslie's thorough list above: remember that the Target build section can be different from the Project build section ( http://stackoverflow.com/questions/1240104/xcode-edit-project-settings-vs-edit-active-target ) and that the Target will take precedence if set. If you forget about this--as I did--you will nearly go crazy. It is not fun, believe me. Make sure your Target settings look like you expect.

john

@wgolling
Copy link

I have this issue, and I don't understand at all.

So, my original project, the one I'm adding Twitter communication to, builds fine. Then I add the Twitter+OAuth folder and I get 140 errors, which is expected. I perform the following steps:

  1. "right" click Frameworks, Add->existing frameworks, then select libxml2.dylib
  2. "right" click project file, select "Get Info". Go to Build tab and find Header Search Paths. Double click, select "Recursive" box, type in "$(SDKROOT)/usr/include/libxml2/", press "OK"
  3. Build. 140 errors.
  4. Project->"edit active target settings", verify that libxml2.dylib is one of the linked libraries. Verify that the Header Search Path is the same as the project's.
  5. Build. 140 errors
  6. Wend through Leslie's list
  7. Build. 140 errors

There's obviously something extremely stupid that I'm just overlooking, because I've followed all the directions and I still get 140 build errors. Does anyone have any ideas?

Will

@wgolling
Copy link

I tried it again in a new project, and it works now. I hate computers.

@rickrets
Copy link

I just had to delete and re-add the libxml2.dylib framework, you should hate computers :)

@Johnb6262
Copy link

Thanks all - this thread saved me hours and hours of pain. OMG the things that happen when you go from debug simulator builds to release adhoc builds... OUCH!

ijansch added a commit to ijansch/Twitter-OAuth-iPhone that referenced this issue Jun 13, 2012
Small fix to make code ARC Compatible (with compiler flags)
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests