I'm seeing some link errors with boost / cpprest in XCode 6.3.1. I was able to replicate the link errors by creating a simple single-view project in XCode. I changed ViewController.m -> ViewController.mm and added a single line ( see below ). I linked my project against boost.framework, security.framework, libcpprest, libssl, libcrypto, and libiconv, per the documentation., and also added all of the appropriate header search paths.
```
#import "ViewController.h"
#include "cpprest/http_client.h"
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
web::http::client::http_client client("https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=cbreed28");
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
```
These are the linker errors I am seeing ( below ). I can't seem to figure out what config setting I am missing. Any thoughts?
```
Undefined symbols for architecture x86_64:
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > boost::locale::conv::to_utf<char>(char const*, char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, boost::locale::conv::method_type)", referenced from:
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > boost::locale::conv::to_utf<char>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, boost::locale::conv::method_type) in libcpprest.a(asyncrt_utils.o)
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > boost::locale::conv::to_utf<char>(char const*, char const*, std::__1::locale const&, boost::locale::conv::method_type) in libcpprest.a(asyncrt_utils.o)
"boost::locale::info::id", referenced from:
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > boost::locale::conv::to_utf<char>(char const*, char const*, std::__1::locale const&, boost::locale::conv::method_type) in libcpprest.a(asyncrt_utils.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```
Comments: Figured it out, the updated boost.sh script was not actually building the 'locale' library. Adding the 'locale' library to the list of libs for boost to build fixed the issue.
```
#import "ViewController.h"
#include "cpprest/http_client.h"
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
web::http::client::http_client client("https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=cbreed28");
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
```
These are the linker errors I am seeing ( below ). I can't seem to figure out what config setting I am missing. Any thoughts?
```
Undefined symbols for architecture x86_64:
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > boost::locale::conv::to_utf<char>(char const*, char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, boost::locale::conv::method_type)", referenced from:
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > boost::locale::conv::to_utf<char>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, boost::locale::conv::method_type) in libcpprest.a(asyncrt_utils.o)
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > boost::locale::conv::to_utf<char>(char const*, char const*, std::__1::locale const&, boost::locale::conv::method_type) in libcpprest.a(asyncrt_utils.o)
"boost::locale::info::id", referenced from:
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > boost::locale::conv::to_utf<char>(char const*, char const*, std::__1::locale const&, boost::locale::conv::method_type) in libcpprest.a(asyncrt_utils.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```
Comments: Figured it out, the updated boost.sh script was not actually building the 'locale' library. Adding the 'locale' library to the list of libs for boost to build fixed the issue.