Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/multithreading/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ MinGW-w64线程创建失败_C++_Multithreading_Exception_C++11 - Fatal编程技术网

C++ MinGW-w64线程创建失败

C++ MinGW-w64线程创建失败,c++,multithreading,exception,c++11,C++,Multithreading,Exception,C++11,分辨率:杂项链接器选项中的pass“-static” ---或--- 分辨率:下载此MinGW版本 我正在使用Eclipse和MinGW-w64工具链。我的GCC版本是4.8 我想创建一个由两个线程组成的应用程序。我已经准备好在我的实际应用程序中实现这一点。因此,它没有工作,我决定做一个新的测试应用程序 来源(main.cpp): 运行时,我收到以下错误: This application has requested the Runtime to terminate it in an unus

分辨率:杂项链接器选项中的pass“-static” ---或--- 分辨率:下载此MinGW版本

我正在使用Eclipse和MinGW-w64工具链。我的GCC版本是4.8

我想创建一个由两个线程组成的应用程序。我已经准备好在我的实际应用程序中实现这一点。因此,它没有工作,我决定做一个新的测试应用程序

来源(main.cpp):

运行时,我收到以下错误:

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
terminate called after throwing an instance of 'std::system_error'
  what():  Operation not permitted
顺便说一句:multi-pthread等命令来自几个尝试,以使其工作。 我正在运行WinVista 32位

如果有人知道如何解决我的问题,我真的很感激。
提前谢谢

有关可添加到任何C++11版本的MinGW的本机win32 std::thread实现,请参见此处:

尝试用<代码> -pTox< /Calp> FLAG编译。你的分配器是什么?@ N.M.我的意思是,我在所有地方都添加了这些标志。我可以在GCC C++编译器和MINW C++中插入任何标志^ ^。linker@RapptzEclipseJuno 4.2.2有些
MinGW-w64
构建了支持
,有些则没有。你是自己建造的,还是从哪里得到的?此外,如果您在vista上,您不应该传递这些标志。
21:19:51 **** Build of configuration Debug for project Test ****
make all 
Building file: ../main.cpp
Invoking: GCC C++ Compiler
g++ -std=gnu++11 -O0 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.d" -o "main.o" "../main.cpp"
Finished building: ../main.cpp

Building target: Test.exe
Invoking: MinGW C++ Linker
g++  -o "Test.exe"  ./main.o   -lpthread -lwinpthread -pthread -lpthread
Finished building target: Test.exe


21:19:53 Build Finished (took 1s.863ms)
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
terminate called after throwing an instance of 'std::system_error'
  what():  Operation not permitted