Overview
Features
Download
Documentation
Community
Add-Ons & Services

Link errors Mountain Lion

Please post support and help requests here.

Link errors Mountain Lion

Postby andyb » 29 Mar 2013, 23:46

Hi All,

I am trying to compile the Logger example using Xcode. If I build the example with the Makefile then it compiles and executes fine but if I create a Xcode project, with the header and libraries set accordingly I get the following link errors:

Code: Select all
Undefined symbols for architecture x86_64:
  "Poco::FileChannel::FileChannel(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      _main in Logger.o
  "Poco::PatternFormatter::PatternFormatter(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      _main in Logger.o
  "Poco::Logger::get(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      _main in Logger.o
  "Poco::Logger::create(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Poco::Channel*, int)", referenced from:
      _main in Logger.o
  "Poco::format(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Poco::Any const&, Poco::Any const&)", referenced from:
      _main in Logger.o
  "Poco::Message::Message(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&, Poco::Message::Priority)", referenced from:
      Poco::Logger::log(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Poco::Message::Priority) in Logger.o
  "Poco::Message::Message(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&, Poco::Message::Priority, char const*, int)", referenced from:
      Poco::Logger::log(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, Poco::Message::Priority, char const*, int) in Logger.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)


If I do the same with the Timer example I don't get any link issues and it works fine from Xcode. However, as soon as I include Logger.h and call Logger::get('') I get a similar link error.

Where am I going wrong? Is there an easy way to generate an Xcode project file from the Makefile?

Thanks, Andy
andyb
 
Posts: 7
Joined: 29 Mar 2013, 23:42

Re: Link errors Mountain Lion

Postby devdavid » 30 Mar 2013, 19:26

Have you compiled the libraries for the architecture your deploying on?
Have you set both Library search paths and header paths with the full path in build settings on XCode?


Code: Select all
$(inherited) "$(SRCROOT)/../../../poco-1.5.1-all2/lib/iPhoneSimulator/i686"


We built POCO as a static library: .a files and included them in xcode in this way, next step is to make a .framework file to glue the headers and library files to one unit..
devdavid
 
Posts: 17
Joined: 11 Mar 2013, 16:10

Re: Link errors Mountain Lion

Postby andyb » 30 Mar 2013, 22:58

Yes, header and library search paths are ok. I only seem to have the problem when I include <Logger.h> as I can compile and execute the Timer example with no problems until I include Logger.h.
andyb
 
Posts: 7
Joined: 29 Mar 2013, 23:42

Re: Link errors Mountain Lion

Postby andyb » 30 Mar 2013, 23:05

Found the problem, in compiler settings it had the C++ standard library option set to libc++ rather than libstdc++.
andyb
 
Posts: 7
Joined: 29 Mar 2013, 23:42


Return to Support

Who is online

Users browsing this forum: No registered users and 5 guests