Htmlcxx in Xcode 5.0.2

Hello, im new in xcode and c++, and im trying to use ths htmlcxx library to parse html and css, but i have some issues, here is the code:
#include <iostream>
#include <html/ParserDom.h>
int main(int argc, const char * argv[])
    //Parse some html code
    std::string html = "<html><body>hey</body></html>";
    htmlcxx::HTML::ParserDom parser;
    tree<htmlcxx::HTML::Node> dom = parser.parseTree(html);
    //Print whole DOM tree
    std::cout << dom << std::endl;
    //Dump all links in the tree
    tree<htmlcxx::HTML::Node>::iterator it = dom.begin();
    tree<htmlcxx::HTML::Node>::iterator end = dom.end();
    for (; it != end; ++it)
        if (it->tagName() == "A")
            it->parseAttributes();
           // std::cout << it->attributes("href");
    //Dump all text of the document
    it = dom.begin();
    end = dom.end();
    for (; it != end; ++it)
        if ((!it->isTag()) && (!it->isComment()))
            std::cout << it->text();
here the errors:
Undefined symbols for architecture x86_64:
  "htmlcxx::HTML::Node::parseAttributes()", referenced from:
      _main in main.o
  "htmlcxx::HTML::ParserDom::parseTree(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      _main in main.o
  "htmlcxx::HTML::operator<<(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, tree<htmlcxx::HTML::Node, std::__1::allocator<tree_node_<htmlcxx::HTML::Node> > > const&)", referenced from:
      _main in main.o
  "vtable for htmlcxx::HTML::ParserDom", referenced from:
      htmlcxx::HTML::ParserDom::~ParserDom() in main.o
      htmlcxx::HTML::ParserDom::ParserDom() in main.o
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
i download the library and put in /Developer/Libs/htmlcxx/, and set the search path in xcode as recursive.
the code is the same on the web, i choose this library cause is pretty easy to use.
anyone can help me..
regards.

That isn't an appropriate place for a library. Did you build the library first? I am guessing no since you would have had another question instead.
Download the source and, in the Terminal do:
tar -zxvf htmlcxx-0.84.tar.gz
cd htmlcxx-0.84
./configure
make
You will get an error because this is sloppy open-source project. Just delete the line where the error occurs and re-run make. Then run "make install"
Then, again in the terminal, you can build your example with:
clang++ -I /usr/local/include/htmlcxx -L/usr/local/lib -lhtmlcxx test.cpp
I think I also changed the html include from <> to "".
I will leave the Xcode as an exercise for the reader.

Similar Messages

  • I updated Xcode 5 to Xcode 6.0.1. It messed up my previous apps and i don't know how to fix it. Is it possible to uninstall Xcode 6 and go back to Xcode 5?

    Hello,
    I updated Xcode 5 to Xcode 6.0.1. It messed up my previous apps and i don't know how to fix it. Is it possible to uninstall Xcode 6 and go back to Xcode 5?

    I found this solution http://objcsharp.wordpress.com/2014/09/21/how-to-get-back-the-ios-7-sdk-after-up grading-to-xcode-6/

  • Access pictures in a particula folder in photo gallery of iphone xcode

    Hi
    I need to access pictures in my iphone photo gallery through xcode,
    I am trying to search code for this but with little success.
    I somebody has knowldge on this please share.
    thanks

    Here is a link to the apple developer site that might help out.
    http://developer.apple.com/

  • Running Xcode 3.2.3 for the first time, hitting an error immediately

    Hello. I'm learning Objective-C from a book ("Beginning Mac Programming"), and I've run into an error right out of the gate. I've checked the book's errata, as well as left a message with the author, but neither have solved the issue.
    Here's what happened:
    1. I installed Xcode 3.2.3 (I'm on 10.6.4)
    2. Opened it
    3. Selected "New Project"
    4. Application->Cocoa Application
    5. Save app location to my user directory
    6. Hit "Build and Run"
    I haven't touched any code at all, yet I get the following error:
    Build TextApp of project TextApp with configuration Debug
    Ld build/Debug/TextApp.app/Contents/MacOS/TextApp normal x86_64
    cd "/Users/dan's/TextApp"
    setenv MACOSXDEPLOYMENTTARGET 10.6
    /Developer/usr/bin/gcc-4.2 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -L/Users/dan's/TextApp/build/Debug -F/Users/dan's/TextApp/build/Debug -filelist /Users/dan's/TextApp/build/TextApp.build/Debug/TextApp.build/Objects-normal/x86 _64/TextApp.LinkFileList -mmacosx-version-min=10.6 -framework Cocoa -o /Users/dan's/TextApp/build/Debug/TextApp.app/Contents/MacOS/TextApp
    ld: file not found: /Users/dans/TextApp/build/TextApp.build/Debug/TextApp.build/Objects-normal/x86_ 64/main.o /Users/dans/TextApp/build/TextApp.build/Debug/TextApp.build/Objects-normal/x86_ 64/TextAppAppDelegate.o
    collect2: ld returned 1 exit status
    Command /Developer/usr/bin/gcc-4.2 failed with exit code 1
    Any suggestions? I'm completely new to this, so I have absolutely no clue what to do next. The error command seems to be looking in the "developer" directory, although the code is saved in my user directory.
    Any help would be greatly appreciated.
    Thank you.

    The /Developer directory contains the compiler(s) and various tools and libraries.
    Does your user account name really contain a single quote? If so, it looks like the quote is getting eaten by one of the build scripts, which is resulting in a file path that doesn't exist.

  • How to set up Open Gl Application in C   using Xcode

    i am trying to work for University Project in Xcode. Xcode always rocks my work but sometimes i probably unaware of its features i get problems like today i am having a problem in creating an application in C++ in which i have to use graphics. i dont know how to create and even setup an Open GL Applciation in Xcode 4.6 please need help.....

    If this is for iOS, have you reviewed the information here? Documentation, sample code, etc.  There is probably a similar page for OS X.
    iOS Dev Center - OpenGL ES Resources
    https://developer.apple.com/devcenter/ios/resources/opengl-es/

  • How do I use a precompiled dylib in my xcode project?

    Hello all you brainiacs out there!
    I want to use mongoDB as my database for my iPhone projects.
    I have compiled their code, with instructions from http://api.mongodb.org/c/current/building.html... successfully.
    I ran all the tests, successfully.
    I have two files, libmongoc.dylib and libbson.dylib generated.
    I have imported them into a brand-new xcode project, (build phases, link binary with libraries, hit '+' sign, add other and browse to these two files)
    I copied the .h files (bson.h and mongo.h) to my project.
    Can I now use the functions in my project as defined to connect, insert, delete.... etc.
    I am a noob at iPhone development (2 months) but I do know what I am doing... (I passed the 2  IOS 5 tests at brainbench.com scoring just under 4/5)
    Can someone walk thru the steps after loading in the dylibs and including the C headers?
    Regards,
    Dan

    Danny Bertrand wrote:
    Is there a list of specific things that you CAN'T do/have to sell on the Apple store?
    The App Store Review guidelines have such a list.
    But rather than focusing on what you can't do, you should focus instead on what you MUST do. One of those "must do" items is comply with any licensing agreements for code or resources you include with your app. It can be quite enlightening to ignore what people say about "open source" and "free software" and actually read those licenses say and research their history. It isn't Apple that is restricting you here . As a wise person once told me - "Follow the money". That will lead you from the Free Software Foundation to academic think tanks and writers right back to .. .some interesting places.
    Welcome to the world of Apple - everybody's bullseye.

  • Help with Xcode 3.2.6 with ios sdk 4.3: will not work...

    So I recenty upgraded my Mac to OS X Snow Leopard (10.6.8) and the xcode that came with it would not work effectively. I just downloaded xcode 3.2.6 with ios sdk 4.3 from Apple and installed them (after having to change the date to 2011). Xcode worked but opening the interface builder resulted in a blank window opening, not the actual interface builder. So then I tried to reinstall the .dmg file of xcode and ios sdk, which was again successful, but when I click on any of the applications it installs to open them I get an error. This is what happens when trying to open xcode:
    Process:         Xcode [4609]
    Path:            /Users/myname/Desktop/Xcode.app/Contents/MacOS/Xcode
    Identifier:      com.apple.Xcode
    Version:         ??? (???)
    Build Info:      DevToolsIDE-18070000~38
    Code Type:       X86 (Native)
    Parent Process:  launchd [92]
    Date/Time:       2012-07-21 23:18:17.358 -0400
    OS Version:      Mac OS X 10.6.8 (10K549)
    Report Version:  6
    Interval Since Last Report:          3537 sec
    Crashes Since Last Report:           13
    Per-App Crashes Since Last Report:   13
    Anonymous UUID:                      F17937FB-B272-4B47-811F-333D66AB2B3B
    Exception Type:  EXC_BREAKPOINT (SIGTRAP)
    Exception Codes: 0x0000000000000002, 0x0000000000000000
    Crashed Thread:  0
    Dyld Error Message:
      Library not loaded: @rpath/DevToolsFoundation.framework/Versions/A/DevToolsFoundation
      Referenced from: /Users/myname/Desktop/Xcode.app/Contents/MacOS/Xcode
      Reason: image not found
    Binary Images:
    0x8fe00000 - 0x8fe4163b  dyld 132.1 (???) <4CDE4F04-0DD6-224E-ACE5-3C06E169A801> /usr/lib/dyld
    Model: MacBook1,1, BootROM MB11.0061.B03, 2 processors, Intel Core Duo, 1.83 GHz, 1 GB, SMC 1.4f12
    Graphics: Intel GMA 950, GMA 950, Built-In, spdisplays_integrated_vram
    Memory Module: global_name
    AirPort: spairport_wireless_card_type_airport_extreme (0x168C, 0x86), Atheros 5424: 2.1.14.6
    Bluetooth: Version 2.4.5f3, 2 service, 12 devices, 1 incoming serial ports
    Network Service: AirPort, AirPort, en1
    Serial ATA Device: FUJITSU MHY2120BH, 111.79 GB
    Parallel ATA Device: MATSHITACD-RW  CW-8221
    USB Device: Built-in iSight, 0x05ac  (Apple Inc.), 0x8501, 0xfd400000 / 2
    USB Device: Apple Internal Keyboard / Trackpad, 0x05ac  (Apple Inc.), 0x0217, 0x1d200000 / 2
    USB Device: IR Receiver, 0x05ac  (Apple Inc.), 0x8240, 0x5d200000 / 2
    USB Device: Bluetooth USB Host Controller, 0x05ac  (Apple Inc.), 0x8205, 0x7d100000 / 2
    Can anyone please help me? Ps, I've changed the directory location to "myname" for security reasons;p so that is not the problem

    The error message is telling you that the linker is looking for the Xcode executable on your desktop and can't find it. Where did you install Xcode? The default location is in /Developer.
    It sounds like you have an outdated alias to Xcode on your desktop. Can you launch Xcode if you navigate to Xcode in the Finder and launch it from there?

  • How do I install  Xcode on a MacBook Pro running 10.7.9 (Lion?)

    I am a retired chap trying to help my grandson get into robotics. He wants to be able to write code to control an Arduino which in turn will control a number of solenoids. I used to design and build hardware and write control software (using Delphi O.O.) for space research equipment. I have  MacBook Pro running   OS X 10.7.9 and have access to an iMAC running OS X 10.6.8
    We want to use C++ (unless anyone can tell us why this might be a bad move) and I have been told I need to install XCode. I looked into it and as far as I can glean, I have to install XCode 4 to be compatible with my MacBook. I downloaded XCode 4.6.2 and ended up with two files, namely :
    xcode4620419895a.dmg
    xcode4620419895a.dmg.part
    and now I am stuck. Firstly, was that the correct version to download? If it is, how do I actually install the development environment from those two files? If I try to execute the disk image it tells me it is unrecognisable. If I try to execute the *.part document it asks me what application I should open it with. Any help/advice will be much appreciated

    Sorry it took me a while to come back. Anyway, I cleared out the old Xcode files and went into the Developers Download area and selected to download 4.6.3 and was presented with this window
    I clicked on Savefile and it downloaded. I was intrigued as to why this would work as it was exactly what I had done before. Out of interest I decided to issue the download again and this time it created a zero byte disk image and a "part" file of 1.6mB. I shall just have to put that behind me (accepting that I don't understand why one download should work and all the precious attempts should fail) and move on.
    Thank you for your help (it was my eyesight that caused me to think my OS version was 10.7.9 - it is indeed 10.7.5)

  • Help !! no output in xcode !!

    hello i just downloaded the OS X maverick and the new xcode 5 and when i open a c   project and write a simple code nothing appears on the output screen !!! , can anyone help me ??

    Working for me
    Are you sure you are creating a command line tool?

  • How to link dynamic library in the Xcode

    Hi all,
    I want to link the dynamic library which is installed in the directory "/usr/local/lib", but I don't know how to set the Xcode to use this library. When I compile the source code by linking the dynamic library, Xcode prints the error information:
    "Checking Dependencies
    Ld /Users/apple/Desktop/test/SPETest/tdstest/build/Release/tdstest normal i386
    cd /Users/apple/Desktop/test/SPETest/tdstest
    /Developer/usr/bin/gcc-4.0 -o /Users/apple/Desktop/test/SPETest/tdstest/build/Release/tdstest -L/Users/apple/Desktop/test/SPETest/tdstest/build/Release -L/Developer/SDKs/MacOSX10.5.sdk/usr/local/lib -L/usr/local/pcsc/lib -F/Users/apple/Desktop/test/SPETest/tdstest/build/Release -filelist /Users/apple/Desktop/test/SPETest/tdstest/build/tdstest.build/Release/tdstest.b uild/Objects-normal/i386/tdstest.LinkFileList -lpcsclite.1.0.0 -arch i386 -dynamiclib -mmacosx-version-min=10.5 /usr/local/lib -isysroot /Developer/SDKs/MacOSX10.5.sdk
    ld: in /Developer/SDKs/MacOSX10.5.sdk/usr/local/lib, can't map file, errno=22
    collect2: ld returned 1 exit status"
    Any suggestion I will appreciate!

    Post to the Developer/SW Development forums under OS X Technologies.

  • I developed an application on xcode 4.2 which is not installing on ios 6.1.3. can any one solve my problem.

    I developed application on xcode 4.2. I prepared .ipa using enterprise distributuin provisional profile file. I am able to installing that application on iPad which is having iOS 5.0. but which is not installing on iOS6.1.3 .
    please provide the reasin why I am unable installing on iOS 6.1.3.
    The application which is developed on lower version Xcode will not install on coming iOS versions like iOS 6.0, 6.1.3, 7.0.?
    To install on latest version what should be the process?

    Unfortunately, I don't have an earlier copy on my computer, since I hadn't needed to use the podcast app until I finally went through all the episodes I had that were playable in music.
    Thanks for your reply, even though it's exactly the kind of answer I didn't want to hear. ;) How aggravating. Ugh.

  • Having a problem with noises and mouse jumping, tried to reinstall and computer will not allow me to select the correct install icon.  Sends me to xcode install

    my kids computer began acting up this spring...so I shut it down. 
    Would not stay turned off, various noises almost continually, jumping highlights, etc.
    Decided to reinstall os x snow leopard.  insert disc and icon appears.  then 3 icons with x in a column.
    automatically highlights middle icon and will not allow me to select one above.  Says install xcode.
    not what i want to do. 
    any help?

    What model iMac do you have?
    What version of Mac OS is it running? If you don't know, try to give approximations on when it was set up and whether it was ever updated so we can take our best guess.
    How are you trying to boot from the install disc? Your description of 3 icons with x in a column' leads me to believe that you aren't booting from the install disc, but rather you are inserting the disc after booting from the OS that is installed on the hard drive. If that is what is happening you'll see something like this, although it will vary depending on the actual version of the Install Disc that you have and how you've chosen to view the files (icon, list, column, etc).
    What happens if you restart the system with the Install Disc inserted, then quickly hold down the 'c' key so that the system attempts to boot from the Install Disc. Do you still experience the same issue?

  • How can i create link between ipad(xcode) and webserver?

    Hi, I'm a new to iPad development and i need help,
    i'm not good with english but i try to explain my question:
    how can i create link between ipad(xcode) and webserver?
    (the webserver ".NET" with driver odbc is connected with DB Oracle)
    so, how can my ipad application access to the Oracle DB?
    Create a webservice (.NET) to be place between iPad and DB, is this correct?
    how can i do it?
    which are libraries to include in the xcode's framework?
    thx

    I think the following URL will be your best answer:
    http://stackoverflow.com/questions/3510468/connecting-iphone-to-an-odbc-database

  • I can't get SDL 1.2 to run in Xcode 5

    Up until recently, I've been using an eight year old iMac running OS X 10.6, but I just bought a brand new six core Mac Pro with OS X 10.10, and I've been trying to get my old SDL 1.2 programs to run.
    I installed Xcode 5 on my new computer (I had read several bad reviews about Xcode 6). I tried opening my old Xcode docs and they wouldn't compile, which I figured might happen, so I went back to the same tutorial video that I used to set up SDL 1.2 on my old computer: http://youtu.be/d3TPsUAO3L4
    And I tried to create a test project just to see if I could get the SDL window to open, but it still wouldn't compile. I got this long list of errors. These are a few of them:
    /SDL1-2_SetUp/SDLMain.m:50:12: Cast of C pointer type 'CFDictionaryRef' (aka 'const struct __CFDictionary *') to Objective-C pointer type 'const NSDictionary *' requires a bridged cast
    /SDL1-2_SetUp/SDLMain.m:166:16: 'release' is unavailable: not available in automatic reference counting mode
    /SDL1-2_SetUp/SDLMain.m:166:16: ARC forbids explicit message send of 'release'
    /SDL1-2_SetUp/SDLMain.m:167:15: 'release' is unavailable: not available in automatic reference counting mode
    /SDL1-2_SetUp/SDLMain.m:167:15: ARC forbids explicit message send of 'release'
    /SDL1-2_SetUp/SDLMain.m:182:15: 'release' is unavailable: not available in automatic reference counting mode
    /SDL1-2_SetUp/SDLMain.m:182:15: ARC forbids explicit message send of 'release'
    Anyway, I don't really understand what this all means, but I didn't get these errors with my SDL projects on my old computer, so I'm wondering if this is because SDL 1.2 is so old it won't run on a current OS? I spent so much time on these programs and I'd really like to be able to run them again, but I don't have the knowhow to update all my code for SDL 2.0. If anyone has any ideas on how to get SDL 1.2 to run in Xcode 5, I'd be so grateful!  And keep in mind that I'm still fairly new to coding (as you've probably guessed), so please try to give me the preschool version!  Thank you.

    The problem is not with the Xcode project folder hierarchy. Your problem is a flaw in the Mac version of SDL 1.2. When you add image files to an Xcode project, Xcode places them in the Resources folder of your application bundle. But the Mac version of SDL 1.2 sets the working directory to the directory containing the application bundle so your game can't find the image files.
    There are two ways to solve the problem. The manual way is to go into your game's app bundle and move the image files from the Resources folder to the directory containing the app bundle. Select your app, right-click, and choose Show Package Contents to access your game's app bundle. The better way is to change the working directory to the app bundle's Resources folder. To change the working directory, open the SDLMain.m file and modify the setupWorkingDirectory: method. The following code sets the working directory to the app bundle's Resources folder:
    NSString *resourcePath = [[NSBundle mainBundle] resourcePath];
    [[NSFileManager defaultManager] changeCurrentDirectoryPath:resourcePath];
    SDL 2 fixes a lot of annoyances with setting up SDL on OS X. You should look into it.

  • Can i create an app in xcode that is just a container to publish other apps ?

    Hello!
    What i want is to create and upload an app to the app store that is like a "private newsstand", where i can publish issues of a magazine that is created only with xcode, not html5 or pdf content.
    This way, our "client" would have a place where to look for this issues, and have all their apps grouped in the store.
    Thank you!

    No, your English is fine.
    Given your description it sounds to me anyway like something that could be handled via a web site and if Apple feels the same then they will probably not OK the app.
    But they have the final say. If you are already a member of the IOS developer program you should be directing these questions to the IOS developer forum.
    You might also want to check out App Store Review Guidelines
    regards

Maybe you are looking for

  • My iPod Touch won't restore on iTunes! It's stuck on recovery mode and I can't get it to restore after I updated the software! Help?

    Okay, so I got an iPod touch, 4th gen, 32gb, brand new and running perfectly fine two years ago. Used it for about six months, lost it, and finally found it again a month ago tucked away in my recliner. It was as dead as a doornail, but I had it char

  • Do you have any kind of help that can be purchased?

    Does Adobe Photoshop Elements 11 have a service where I can receive selected step by step advice for a nominal fee? My question is simple, however; my problem is I'm not smart enough to know how to ask the question the correct way. All I want to know

  • 9.1 UI Customization for Field Display Size

    Hi, Guys, Just upgrade from 9.0 to 9.1 and started to do the UI customization. I noticed it seems that we can move around those fields on the forms, but we can not resize them. Is that correct? If we can, please advise how to. How about UDFs? Frank

  • JSF 1.2 commons version

    Hi: I have already asked this question on another thread but now I think I can be more specific about the problem. I am trying to install Richfaces on JSF Visual. I have noticed that there are classes that are found in the commons 3.2 collections tha

  • Replied Arrow in Mac Mail not synching properly between Macs

    Hi there We have a mac pro and a macbook both with mac mail. The email account is a gmail account and the two Macs are synchronised by mobileme. I have noticed that the macbook does not show reply arrows on emails replied to on the mac pro and the ma