如何在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