如何在Qt应用程序中使用windows.h?包括它后,我得到几个错误,如包括的Qt错误<windows.h>
c:\Qt\4.4.3\include/QtCore/../../src/corelib/arch/qatomic_windows.h:387: error:
declaration of C function 'long int InterlockedCompareExchange(long int*, long int,
long int)' conflicts with
d:\old\mingw\bin\../lib/gcc/mingw32/4.3.3/../../../../include/winbase.h:1681: error:
previous declaration 'LONG InterlockedCompareExchange(volatile LONG*, LONG,
LONG)' here
所有依次包括:
windows.h
iostream
QtCore
QtGui
QObject
QString
QFile
QProcess
QIODevice
编辑:问题消失,Process.start()
现在工作,但我不能说,什么样的变化带来的改变。
编辑2:并不那么简单。我会创建一个新问题。
编辑3:相同的代码QProcess Process; Process.start("notepad.exe");
在main()
工作,并且不起作用称为插槽功能。仅适用于QProcess *Process = new QProcess(); Process->start("notepad.exe");
我很好奇,为什么你需要在Qt应用程序中包含'windows.h'? – 2010-10-14 07:22:05
QProcess流程;的Process.Start( “Notepad.exe的”);抛出QProcess :: UnknownError。因此我需要使用WinExec()或system()。 – DSblizzard 2010-10-14 07:52:15