User forums > Embedded development
codeblocks and the use of threads with C
Rob Rob:
Hey, I have to divide a program which only consists of the main funktion into threads. Can I perform that with codeblocks? I have read that I have to install the Pthread library in order to use threads.
(http://openbook.galileocomputing.de/c_von_a_bis_z/026_c_paralleles_rechnen_004.htm)
[11:16:42] El Elroccomo: If that is correct, where can I find the Pthread Bibliothek and how can I embedd it in codeblocks?
BlueHazzard:
C::B IS NOT A COMPILER
c::b IS A IDE
with c::b you write the code, it is basically a text editor with a lot additional features. The compiler is your choice: this depends from operating system and needed functionality.
So: principally you can write code for anything in c::b. But if it is supported from the compiler beneath, this c::b don't know and also doesn't care.
Since you are not posting your compiler, os version, i'm not able to help you future.
I can tell you to read about compilers, and look how your compiler implements pthread. Then you will find out what compiler switch you will need, and then you can ask here how to add this switch in c::b or even better you can read it in the wiki: http://wiki.codeblocks.org/index.php?title=FAQ
if you encounter some compiling/linking errors read and follow this instruction: http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F
greetings
Rob Rob:
I use Xubuntus 13.04 and i use the GCC compiler.
I wanted to use the consol command: gcc-4.2 -Wall -fopenmp -o
BlueHazzard:
Well, add -fopenmp in Project->Build Options-> Compiler Settings-> Other Settings
and in Project->Build Options -> Linker settings-> Other linker settings
Rob Rob:
what should I write in "other settings"?
and where can I find the linker librarie I needed?
and and what librarie I need?
Navigation
[0] Message Index
[#] Next page
Go to full version