0

I'm trying to use AppVeyor for a C++ program made using Qt. My appveyor.yml only do the 3 following things:

    - cd Project
    - qmake Project.pro
    - mingw32-make

But when AppVeyor is trying to compile my project it tells me

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

I'm sure the problem isn't from my code because it works on my computer or when using Travis CI

I'm also putting a link to the CI just in case: https://ci.appveyor.com/project/Xwilarg/programmanager/builds/23421335

Would someone please know how I can use std::thread in AppVeyor ?

Xwilarg
  • 364
  • 1
  • 6
  • 16
  • 1
    Possible duplicate? https://stackoverflow.com/questions/37358856/does-mingw-w64-support-stdthread-out-of-the-box-when-using-the-win32-threading – Shloim Mar 28 '19 at 11:28

2 Answers2

0

I'm assuming that you've included <thread>, so the next guess would be that std::thread is part of c++11. You need to enable c++11 in your project.

Shloim
  • 5,281
  • 21
  • 36
  • I don't have any problem using things like unique_ptr so I think that C++11 already is enabled for the project – Xwilarg Mar 28 '19 at 11:23
0

I finally found the answer of my question.

As Shloim said, I had to use https://github.com/meganz/mingw-std-threads

Then my CI wasn't able to find GetNativeSystemInfo so I had to add -D _WIN32_WINNT=0x0501 in the compile flags

Xwilarg
  • 364
  • 1
  • 6
  • 16