1

I am on Win10. I installed MinGW in Anaconda through

$ conda install -c anaconda mingw

But when I check with $ g++ -v

I see Thread model: win32, which does not support C++11 Thread class. As results when I run $ g++ myprogram.cpp -std=c++11 I got error

error: 'thread' is not a member of 'std'

Outside of Anaconda, I installed MinGW with installer from https://sourceforge.net/projects/mingw-w64/

When installing, choose "posix", and I got what I need.

So my question is, how to make this happen in Anaconda? I want to either

  1. Set Anaconda's C++ compiler to the one outside (the one I installed with installer)
  2. or, install a MinGW with posix in Anaconda.

I tried to find solutions online, the following helped me sorted out my questions. But I couldn't find a solution yet.

Troubles with POSIX program using threads with gcc

https://coderwall.com/p/rzkw6q/compile-c-code-with-c-11-threads

https://docs.conda.io/projects/conda-build/en/latest/resources/compiler-tools.html

The full output is as below. I appreciate for your help!

$ g++ -v

Using built-in specs.
COLLECT_GCC=C:\ProgramData\Anaconda3\Scripts\g++.bat\..\..\MinGW\bin\g++.exe
COLLECT_LTO_WRAPPER=c:/programdata/anaconda3/mingw/bin/../libexec/gcc/x86_64-w64-mingw32/4.7.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../../../build/gcc/src/configure --target=x86_64-w64-mingw32 --prefix=/c/bb/vista64-mingw32/mingw-x86-x86_64/build/build/root --with-sysroot=/c/bb/vista64-mingw32/mingw-x86-x86_64/build/build/root --enable-languages=all,obj-c++ --enable-fully-dynamic-string --disable-multilib
Thread model: win32
gcc version 4.7.0 20111220 (experimental) (GCC)
David
  • 819
  • 1
  • 11
  • 14
  • Looks like Anaconda package has this particular version of gcc. The question seems to be better directed at Anaconda maintainers. – SergeyA Jul 09 '19 at 20:59

0 Answers0