Overview
Features
Download
Documentation
Community
Add-Ons & Services

compile POCO undefined reference to `__sync_add_and_fetch_4'

Please post support and help requests here.

compile POCO undefined reference to `__sync_add_and_fetch_4'

Postby CER » 20 Jan 2012, 00:08

Hello

I am trying to install Poco 1.4.3, downloaded today, on a Centos 5 linux box.
I did:
./configure --omit=Data/MySQL
gmake -s

and got the following error:
Code: Select all
** Compiling src/MemoryStreamTest.cpp (debug, shared)
** Building shared executable (debug) /websites/libraries/poco/poco-1.4.3/Foundation/testsuite/bin/Linux/i686/testrunnerd
/websites/libraries/poco/poco-1.4.3/Foundation/testsuite/obj/Linux/i686/debug_shared/ActiveMethodTest.o: In function `Poco::AtomicCounter::operator++()':
/websites/libraries/poco/poco-1.4.3/Foundation/include/Poco/AtomicCounter.h:260: undefined reference to `__sync_add_and_fetch_4'
/websites/libraries/poco/poco-1.4.3/Foundation/testsuite/obj/Linux/i686/debug_shared/ActiveMethodTest.o: In function `Poco::AtomicCounter::operator--()':
/websites/libraries/poco/poco-1.4.3/Foundation/include/Poco/AtomicCounter.h:272: undefined reference to `__sync_sub_and_fetch_4'
/websites/libraries/poco/poco-1.4.3/Foundation/testsuite/obj/Linux/i686/debug_shared/CoreTest.o: In function `Poco::AtomicCounter::operator++(int)':
/websites/libraries/poco/poco-1.4.3/Foundation/include/Poco/AtomicCounter.h:266: undefined reference to `__sync_fetch_and_add_4'
/websites/libraries/poco/poco-1.4.3/Foundation/testsuite/obj/Linux/i686/debug_shared/CoreTest.o: In function `Poco::AtomicCounter::operator--(int)':
/websites/libraries/poco/poco-1.4.3/Foundation/include/Poco/AtomicCounter.h:278: undefined reference to `__sync_fetch_and_sub_4'
collect2: ld returned 1 exit status
gmake[2]: *** [/websites/libraries/poco/poco-1.4.3/Foundation/testsuite/bin/Linux/i686/testrunnerd] Error 1
gmake[1]: *** [projects] Error 2
gmake: *** [Foundation-tests] Error 2


I am stuck here without any idea on what to do next

Thanks!
CER
 
Posts: 5
Joined: 20 Jan 2012, 00:04

Re: compile POCO undefined reference to `__sync_add_and_fetc

Postby guenter » 24 Jan 2012, 13:25

Seems that your compiler does not support the GCC built-in atomic functions. As a quick workaround, comment-out line 50 (#define POCO_HAVE_GCC_ATOMICS
) in Foundation/include/AtomicCounter.h and rebuild Foundation.
guenter
 
Posts: 1138
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: compile POCO undefined reference to `__sync_add_and_fetc

Postby prehley » 08 May 2012, 00:34

Hello,

We are also seeing this message. The gcc version we are using is gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-46), and I know that the poco code says that this version should be ok. Is this something that will be corrected? What other information would be helpful for you regarding this problem?

I've already did the work around to move past this issue.

Thanks,
Peter
prehley
 
Posts: 10
Joined: 01 Feb 2012, 22:21


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron