User forums > Using Code::Blocks
Linking the pthread library
BlueHazzard:
don't enter pthread under libraries, but in additional linker options as -pthread
renebarto:
One more post, as I think I've figured out what is going wrong: The command buffer is too small. Only part of the command line is sent to sh. I've added an echo to the linker command, and it leaves out part of the command line. I am currently trying out cb 10.05, on Ubuntu 12.04 with gcc.
-------------- Build: Debug in Core.Test ---------------
echo g++ -L../../../bin/Debug -o ../../../bin/Debug/Core.Test obj/Debug/external/gtest/gtest-all.o obj/Debug/src/CoreActiveObjectTest.o obj/Debug/src/CoreArrayTest.o obj/Debug/src/CoreAutoEventTest.o obj/Debug/src/CoreByteArrayTest.o obj/Debug/src/CoreCyclicBufferTest.o obj/Debug/src/CoreManualEventTest.o obj/Debug/src/CoreMutexTest.o obj/Debug/src/CoreStreamTest.o obj/Debug/src/CoreTextReaderTest.o obj/Debug/src/CoreTextWriterTest.o obj/Debug/src/CoreThreadTest.o obj/Debug/src/CoreTimeStampTest.o obj/Debug/src/CoreTimerTest.o obj/Debug/src/CoreWorkerThreadTest.o obj/Debug/src/Main.o -Wl,-rpath,'$ORIGIN' -lCore -lpthread -lrt
g++ -L../../../bin/Debug -o ../../../bin/Debug/Core.Test obj/Debug/external/gtest/gtest-all.o obj/Debug/src/CoreActiveObjectTest.o obj/Debug/src/CoreArrayTest.o obj/Debug/src/CoreAutoEventTest.o obj/Debug/src/CoreByteArrayTest.o obj/Debug/src/CoreCyclicBufferTest.o obj/Debug/src/CoreManualEventTest.o obj/Debug/src/CoreMutexTest.o obj/Debug/src/CoreStreamTest.o obj/Debug/src/CoreTextReaderTest.o obj/Debug/src/CoreTextWriterTest.o obj/Debug/src/CoreThreadTest.o obj/Debug/src/CoreTimeStampTest.o obj/Debug/src/CoreTimerTest.o obj/Debug/src/CoreWorkerThreadTest.o obj/Debug/src/Main.o -Wl,-rpath,
Process terminated with status 0 (0 minutes, 0 seconds)
0 errors, 0 warnings
BlueHazzard:
look at my previous post.
(c::b 10.05 is really old, don't expect many support for this old version, it has changed a lot since them)
please post logs/code in code tags...
greetings
renebarto:
Thx I was not aware of that. I will download the current version for Ubuntu.
mloutris:
--- Quote from: BlueHazzard on January 16, 2014, 11:45:36 pm ---don't enter pthread under libraries, but in additional linker options as -pthread
--- End quote ---
I ran into this as well. To be more precise, in CB 16.01, from the top menu bar, select 'Settings->Compiler'
Then select the 'Linker Settings' tab, and near the bottom of the window, select the 'Add' button,
enter 'pthread' (without the single quotes!), as Code::Blocks will prepend the '-l' automatically.
Click on the 'OK' button and rebuild.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version