DISQUS

Damien's Mind: Setting up MGTwitterEngine with YAJL 1.0.6 for iPhone development

  • Matt Donnelly · 6 months ago
    THANK YOU SO MUCH!!!!!!!! This has been giving me headaches for days!
  • Dislay · 6 months ago
    THANK YOU AHAHAHAH !!!!! YEAHHHHHHHHHHH BABY !!!!!!!!
  • Dan Morgan · 5 months ago
    Oh my god I love you
  • Dan Morgan · 5 months ago
    during the compile of YAJL I get this error:

    Scanning dependencies of target yajl
    CMake Error: Cannot open file for write: /Users/morgz/yajl/build/src/CMakeFiles/yajl.dir/depend.make.tmp
    CMake Error: : System Error: Permission denied

    :-( Looks like my YAJL celebrations were premature
  • Damien · 5 months ago
    Have you tried sudo'ing the commands? That usually gets the permission errors solved.
  • Dan Morgan · 5 months ago
    Hey Damien - Thanks for the reply.

    I copied this directly into the console:

    sudo ./configure && make install

    Is sudo'ing when the command begins with the word sudo? I've had nothing but nightmares with YAJL!
  • Dan Morgan · 5 months ago
    Hey Damien,

    Is there any chance you could uplaod the files so I could then copy them into /usr/local/lib/ and /usr/local/include/yajl manually?

    Thanks

    D
  • thnk2wn · 5 months ago
    Did you get around this problem? I've tried changing the folder permissions of yajl/build/src/CMakeFiles/yajl.dir but somehow it keeps getting set back to readonly.
  • Dan Morgan · 5 months ago
    No :-( I also set the permissions and I still cant sudo the files into them. I'm gonna try and manually copy the files from the YAJL folder into the respective usr folders. Will let you know how I get on.
  • Mowglii · 4 months ago
    instead of doing:

    sudo ./configure && make install

    break it up into two commands:

    sudo ./configure
    sudo make install
  • dev · 1 month ago
    Thanks for this tip!
  • fabiankr · 5 months ago
    Hi,

    I added the search paths and it should work correctly, but it always ends saying it can't find the <yajl/yajl_parse.h> header...
    Don't know what I'm doing wrong here.

    Help appreciated. ;)
  • Alex K · 5 months ago
    I was having a similar problem. I noticed that in the instructions here, it says to include /usr/local/lib/yajl in the header search path; however, on my machine, it installed the yajl headers to /usr/local/include/yajl. That might fix it for you. (It didn't for me -- I had to copy the headers in that directory directly into Xcode and then modify how they referred to each other -- changing <yajl/yajl_common.h> to "yajl_common.h", for instance.)
  • Jared Holdcroft · 5 months ago
    I had this exact problem but changing the header search path to be just /usr/local/include fixed it. If you don't it expects yajl/yajl_parse.h to be in /usr/local/include/yajl/yajl!
  • Yong Rong Hou · 5 months ago
    You are right. The include path should (of course) be /usr/local/include/yajl. That was my mistake. just corrected it in the article.
  • peterxu · 5 months ago
    The way I solved this problem is that I made the folder
    /usr/local/lib and /usr/local/include "read and write" from "read only" in the finder. (use "go to folder" in finder and type the address)

    Hope that helps!

    btw: if you are developing for iphone OS 3.0 as I did, you might get error with [NSApp terminate:self] in the delegate file. I used "exist (0)" instead. I wander if anyone has the same problem

    Also can anyone inform me how to get the status data? I tried:
    NSMutableArray *user1= [message objectAtIndex:0];
    in the statusesReceived method but get the NSCFArray beyond bounds error.
  • intomo · 3 months ago
    I've followed your suggestions above, but regardless of which search path I add it still won't compile. I still get an error about it can't find "yajl_parse.h" and 28 other dependant errors. Questions: I'm new to Mac so exactly where is /user/local/ on my drive? When I Go To Folder in the finder it says that folder doesn't exist. Do I need to add the yajl files any place physically, or just add the framework via the .a file? Do I need to add the class files in that folder to my classes? Many thanks in advance!
  • thnk2wn · 5 months ago
    In the end that part didn't end up mattering in my case. I didn't see his update regarding the compiled YAJL static library for iPhone and libYAJLIPhone.a. I was able to just use that and copy the YAJL header files to the include directories and set the project search paths. I haven't tested out the code but I have it compiling now.
  • Dan Morgan · 5 months ago
    Thnk2wn. Would you be as kind to upload an example of the proj? I've been struggling with this for soo long now and I'm still getting 44 errors
  • thnk2wn · 4 months ago
    See http://files.getdropbox.com/u/235508/iPhone/MGT... but note that (a) this is from a stripped down copy of my app and (b) it may not be at this location long. Also you'll still need the include files (usr/local/include) etc.
  • Dan Morgan · 4 months ago
    Thanks you so so much. I've tested this and it works perfectly. I just had to change the header search path for the libxml2 to include a final '/'. Fantastic, you have no idea how long this has been doing my nut in for.
  • Jesse Armand · 4 months ago
    I decided to do what gabriel did on yajl-objc, which is by including all of the yajl source code in the project, instead relying on that static library, because I also need this for iPhone OS 2.x.
  • joe_carney · 3 months ago
    I've followed your instructions and now when I compile, I get this...

    Library not found for -lyajl

    Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1

    Can't find anything on the Internet to help me out. I'd really like to use this but it has been an absolute nightmare getting started with it...

    Any ideas?
  • Parimal Satyal · 3 weeks ago
    Thanks so much for this article. After going through it and, I'll admit, encountering a whole lot of errors, mostly as a result of my unfamiliarity with Obj-C, JSON, XML and the SDK, it finally works!

    In my case, I had to put in "/usr/local/include/" (without the 'yajl' sub-directory) as a Header Search Path to get it to work. Wouldn't see the file otherwise. (This took a while for me to figure out :P)

    A tip with adding the libxml2.dylib framework to the project:
    Instead of using Finder and dragging it in, you can also command-click Resources › Add › Existing Frameworks, and chose libxml2.dylib

    I could previously only find "libxml2.2.dylib", and this doesn't seem to work very well.

    谢谢给这篇真好的文章!