Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/7.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++ Qt:minGW的编译问题_C++_Qt_Compilation_Mingw - Fatal编程技术网

C++ Qt:minGW的编译问题

C++ Qt:minGW的编译问题,c++,qt,compilation,mingw,C++,Qt,Compilation,Mingw,我需要编译一个Qt环境。 但在编译时,我得到以下消息: g++ -Wl,-s -mthreads -Wl,-subsystem,windows -o release\Prog.exe object_script.Prog.Release -L"c:\DevProgs\Qt\4.8.6\lib" -lmingw32 -lqtmain build\objects\myapp_res.o -LC:/Windows/System32 -lftd2xx -LC:/qwt-6.0.1/lib -lqwt -

我需要编译一个Qt环境。 但在编译时,我得到以下消息:

g++ -Wl,-s -mthreads -Wl,-subsystem,windows -o release\Prog.exe object_script.Prog.Release -L"c:\DevProgs\Qt\4.8.6\lib" -lmingw32 -lqtmain build\objects\myapp_res.o -LC:/Windows/System32 -lftd2xx -LC:/qwt-6.0.1/lib -lqwt -lQtSql4 -lQtGui4 -lQtNetwork4 -lQtCore4 
[MGWPATH]/i686-w64-mingw32/lib/../lib/crt2.o:crtexe.c:(.text+0x1fb): undefined reference to `_imp__Sleep@4'
[MGWPATH]/i686-w64-mingw32/lib/../lib/crt2.o:crtexe.c:(.text+0x293): undefined reference to `_imp__SetUnhandledExceptionFilter@4'
Makefile.Release:303: recipe for target 'release\Prog.exe' failed
[MGWPATH]/i686-w64-mingw32/lib/../lib/crt2.o:crtexe.c:(.text+0x2a7): undefined reference to `_set_invalid_parameter_handler'
[MGWPATH]/i686-w64-mingw32/lib/../lib/crt2.o:crtexe.c:(.text+0x475): undefined reference to `_imp__GetStartupInfoA@4'
[MGWPATH]/i686-w64-mingw32/bin/ld.exe: [MGWPATH]/i686-w64-mingw32/lib/../lib/crt2.o: bad reloc address 0x0 in section `.CRT$XCAA'
collect2.exe: error: ld returned 1 exit status
其中
[MGWPATH]
C:/DevProgs/mingw32/bin/。/lib/gcc/i686-w64-mingw32/4.8.2/。/../../../../

我成功地单独运行了Qt4.8.6的小演示,并使用Qwt运行了一个

我唯一的疑问是关于ftd2xx库。 但是,我认为它链接正确,因为如果我不链接DLL,我会产生未定义函数的错误

我不清楚错误信息。所以,我完全不知道从这里往哪里看

有人能帮我吗?
谢谢大家!

请尝试添加-lkernel32(适用于Windows),因为SetUnhandledExceptionFilter和GetStartupInfo来自内核32库。您好,谢谢您的建议。不幸的是,它没有解决我的问题!您是否有完全相同的错误?-LC:/Windows/System32不是存储Win lib文件的路径。它应该类似于
[MGWPATH]\i686-w64-mingw32\lib
。您可以尝试删除-LC:/Windows/System32,并让链接器找到内核32本身的正确版本。