0
votes

I use gcc (Ubuntu 4.8.4-2ubuntu1~14.04.1) 4.8.4 with Eclipse CDT Version: Luna Service Release 2 (4.4.2).

My program does not use any library, not pthread and neighter gthread. It uses the C++11 standard, which is set with the dialect drop down menu in C++-Compiler options.

The GCC Linker for g++ produces the following error:

./src/main.o:(.rodata+0x1e8): undefined reference to `__gthrw___pthread_key_create(unsigned int*, void ()(void))'

I already searched about how to disable weak symbol references, but wasn't lucky.

Can anyone give some advise?

1

1 Answers

0
votes

Found out that it is somehow related to g++-4.8.

I installed g++-5 and the error was gone.

Here are the steps:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install g++-5 libstdc++-5-dev

sudo rm -f /usr/bin/g++
sudo ln -s /usr/bin/g++-5 /usr/bin/g++