Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

__gthrw_pthread_once undefined...

fons-rademakers
Beginner
433 Views
Hi,

I try to use icc 20051201 on an up to date FC4 system which has the gcc 4.0.2 compiler and run-time. Compiling and application using -pthread and linking with -pthread gives:

cint/src/bc_autoobj.o(.text+0x302): In function `G__push_autoobjectstack':
cint/src/bc_autoobj.cxx: undefined reference to `__gthrw_pthread_once(int*, void (*)())'


Where can I find this __gthrw_pthread_once() function?

Cheers, Fons.
0 Kudos
1 Reply
John_O_Intel
Employee
433 Views
Hi Fons,
gcc added a weakref attribute in gcc 4.1, and this has been back ported to earlier gcc releases, including some gcc 4.0.2 builds.
$ icpc hello.cpp
/tmp/icpcNESOf3.o(.text+0x52c): In function `main':
hello.cpp: undefined reference to `__gthrw_pthread_once(int*, void (*)())'
For now, the work around is to use:
$ icpc hello.cpp -D_GLIBCXX_GTHREAD_USE_WEAK=0 -pthread
We expect to support this feature without the above work around in the 9.1 release that is upcoming, expected in the next few months. The gcc feature was introduced in gcc 4.1, and has been back ported to earlier gcc releases. I suggest you open a support issue at http://premier.intel.com so you will be notified when this feature is available in the 9.1 compilers.
FYI there isa similar thread on this topic at
best regards,
_|ohnO
0 Kudos
Reply