私はMinGWでQt Creatorを使用しています。MinGWを使用してwinsock2.hを含めることはできません
"windows.h"を含めてコンパイルしましたが、失敗しました。エラーは次のとおりです。
In file included from c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/windows.h:98:0,
from util/IdleDetector.h:8,
from service\PresenceService.cpp:8:
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/winsock2.h:771:22: error: expected unqualified-id before string constant
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/winsock2.h:1034:95: error: expected identifier before string constant
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/winsock2.h:1034:95: error: expected ',' or '...' before string constant
私はMinGWパスが欠落していると考えましたが、そうではありません。これをどうすれば解決できますか?
あなたのwinsock2.hの行771と1034は何ですか? Windows.hの前に明示的にwinsock2.hを含めようとしましたか? – thiton
これらの行には文字列定数はありません。完全なコンパイルコマンドを表示して、 '#define'をチェックしてください。 'GROUP'が文字列リテラルに定義されている場合、これらの2行は無効になります。 – Mat
私はGROUP編集でそれを解決しました。ありがとうございました –