News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

How to get code containing pthreads to compile on Windows?

Started by c_weed, October 09, 2013, 11:26:27 AM

Previous topic - Next topic

c_weed

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?

stahta01

Quote from: 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?

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.next.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-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]