• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Using Boost C++ library in Xcode
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using Boost C++ library in Xcode


  • Subject: Re: Using Boost C++ library in Xcode
  • From: Chris Espinosa <email@hidden>
  • Date: Thu, 13 Sep 2007 09:07:27 -0700


On Sep 13, 2007, at 8:32 AM, Ivan C Myrvold wrote:

I have compiled the Boost from http://www.boost.org/ , and had no problems building it.

When testing it in Xcode, I had no problem with a small test program using the header-only library.
I just had to set the Header Search Paths pointing to my folder where the boost source were (/Users/imyrvold/Documents/Tansa/cpp/boost_1_34_1).

But when I tested Xcode with a program, which shall link with a Boost binary library (which I have successfully built), I got problems.
It built ok in Debug mode, but when running it, I got these messages:

Ivan-C-Myrvolds-MacBook:~/Documents/Tansa/cpp/testprojects/boost_example2/build/Debug imyrvold$ ./boost_example2 < jayne.txt
ZeroLink: unknown symbol '__ZN5boost11basic_regexIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE9do_assignEPKcS7_j'
Abort trap

The small program is this:

#include <boost/regex.hpp>
#include <iostream>
#include <string>

int main () {
    std::string line;
boost::regex pat( "^Subject: (Re: |Aw: )*(.*)" );


while (std::cin) {
std::getline(std::cin, line);
boost::smatch matches;
if (boost::regex_match(line, matches, pat))
std::cout << matches[2] << std::endl;
}

    return 0;
}


I think I have not linked against the Boost binary, but how do I do that?

Generally, you find the library built with your Boost project, and drag and drop it into the "Link Binaries with Libraries" build phase.

The Zero Link feature is meant for debugging apps that are already building correctly, and skips the link step and loads all referenced libraries at run time.  That's why you're getting what is essentially a linker error when you run your program.  You can uncheck "Allow ZeroLink" from the Build menu to defeat this and get your linker errors at link time.

Chris 
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Using Boost C++ library in Xcode (From: Ivan C Myrvold <email@hidden>)

  • Prev by Date: Using Boost C++ library in Xcode
  • Next by Date: Re: Using Boost C++ library in Xcode
  • Previous by thread: Using Boost C++ library in Xcode
  • Next by thread: Re: Using Boost C++ library in Xcode
  • Index(es):
    • Date
    • Thread