Overview
Features
Download
Documentation
Community
Add-Ons & Services

Undefined symbols when building for iPhone simulator

Please post support and help requests here.

Undefined symbols when building for iPhone simulator

Postby devdavid » 16 Mar 2013, 13:37

Hi,
When i try to build a simple JSON example with a static poco library in XCODE i get the following:

Undefined symbols for architecture i386:
"Poco::AtomicCounter::AtomicCounter(int)", referenced from:
Poco::ReferenceCounter::ReferenceCounter() in ListType.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Code: Select all
#ifndef __PocoTest2__ListType__
#define __PocoTest2__ListType__

#include <iostream>
//#include <Poco/JSON/JSON.h>
#include <Poco/JSON/Array.h>
//#include <Poco/JSON/Parser.h>
//#include <Poco/JSON/DefaultHandler.h>
//#include <Poco/JSON/Object.h>
//#include <Poco/Dynamic/Var.h>

#include <String.h>
using namespace Poco::JSON;
using namespace Poco::Dynamic;

using namespace std;


class ListType{
private:
    const std::string LIST_REF = "ListRef";
    Array::Ptr listRefs; // This line generates error!
   
public:
    ListType();
    void deserialize( string jsonString);
};

#endif /* defined(__PocoTest2__ListType__) */


Any suggestions on why and what it's complaining about?

BR
devdavid
 
Posts: 17
Joined: 11 Mar 2013, 16:10

Re: Undefined symbols when building for iPhone simulator

Postby rakesh » 18 Mar 2013, 02:53

It would appear you have not linked to PocoFoundation.a.
rakesh
 
Posts: 78
Joined: 13 Apr 2011, 17:43
Location: Chicago

Re: Undefined symbols when building for iPhone simulator

Postby devdavid » 21 Mar 2013, 12:29

Problem was both the i686(iphone simulator) and the armv7, armv6 libs where included at the same time in XCode Library search paths... I now manually set library search path deppending on if im building for device or simulator. I havent managed to create a conditional buildsetting for this, so if any of you guys know how to do this, please tell me :)
devdavid
 
Posts: 17
Joined: 11 Mar 2013, 16:10

Re: Undefined symbols when building for iPhone simulator

Postby rakesh » 21 Mar 2013, 16:25

If you read the post in the tips and tricks section about setting up Xcode to use Poco for iOS, you will see screen captures of how to configure different settings for the different types of builds.
rakesh
 
Posts: 78
Joined: 13 Apr 2011, 17:43
Location: Chicago

Re: Undefined symbols when building for iPhone simulator

Postby devdavid » 21 Mar 2013, 16:30

rakesh wrote:If you read the post in the tips and tricks section about setting up Xcode to use Poco for iOS, you will see screen captures of how to configure different settings for the different types of builds.

Link:
http://pocoproject.org/forum/viewtopic.php?f=14&t=4844
devdavid
 
Posts: 17
Joined: 11 Mar 2013, 16:10


Return to Support

Who is online

Users browsing this forum: No registered users and 7 guests