Author Topic: Code::Blocks and the gcc option -mthreads  (Read 6541 times)

wxLearner

  • Guest
Code::Blocks and the gcc option -mthreads
« on: March 15, 2007, 10:20:09 pm »
Hello,
while looking in the build options of the windows Code::Blocks project from svn, I've realized, that the option -mthreads is used during compiling only, but it looks like the option is needed during linking too:
Quote from: gcc manual
-mthreads
    Support thread-safe exception handling on `Mingw32'. Code that relies on thread-safe exception handling must compile and link all code with the -mthreads option. When compiling, -mthreads defines -D_MT; when linking, it links in a special thread helper library -lmingwthrd which cleans up per thread exception handling data.
I've done a small test and the result is, a program doesn't need mingw10m.dll, if -mthreads isn't used in Linker settings/Other linker options. I'm not sure, but it looks like mingwm10.dll is only needed by wxWidgets and Code::Blocks isn't linked thread-safe on windows.
Please correct me, if I'm wrong.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Code::Blocks and the gcc option -mthreads
« Reply #1 on: March 15, 2007, 11:11:51 pm »
If it's not in the project settings then you 're right: it should be added.
Be patient!
This bug will be fixed soon...