Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: c_weed on October 09, 2013, 11:26:27 am

Title: How to get code containing pthreads to compile on Windows?
Post by: c_weed on October 09, 2013, 11:26:27 am
I've got some source code containing pthreads and want to build it and run it on Windows. I have mingw installed so I think I should be able to. I was getting errors when compiling through Codeblocks and I added "-pthread" under "other linker options" and it helped but I still get the error "mingw32-g++.exe: error: unrecognized option '-pthread'" and the program exits immediately. How can I fix this?
Title: Re: How to get code containing pthreads to compile on Windows?
Post by: stahta01 on October 09, 2013, 03:25:40 pm
I've got some source code containing pthreads and want to build it and run it on Windows. I have mingw installed so I think I should be able to. I was getting errors when compiling through Codeblocks and I added "-pthread" under "other linker options" and it helped but I still get the error "mingw32-g++.exe: error: unrecognized option '-pthread'" and the program exits immediately. How can I fix this?

Use a compiler that supports the option "-pthread".

You will likely need to change OS to do this.

Read the FAQs and Rules. http://forums.codeblocks.org/index.php/topic,9996.0.html (http://forums.codeblocks.org/index.php/topic,9996.0.html)

Make sure you read and understand these FAQs
http://wiki.codeblocks.org/index.php?title=FAQ-General#Q:_What_Code::Blocks_is_not.3F (http://wiki.codeblocks.org/index.php?title=FAQ-General#Q:_What_Code::Blocks_is_not.3F)
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F (http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F)

Tim S.