Qt 5.3将@ debug / mocinclude.tmp添加到Windows端口中的MOC.exe

时间:2014-06-07 15:03:59

标签: qt porting qmake

我尝试将mac应用程序移植到Windows, 使用Qt 5.3 windows 7和visual studio 2012。我完成了几个简单的项目,一切正常 但现在我尝试用qmake创建VS应用程序后移植mac应用程序 我收到此MOC.exe错误:

D:\Qt\Qt5.3.0\5.3\msvc2012_opengl\bin\moc.exe  -DUNICODE -DWIN32 -DQT_NO_KEYWORDS -DCC_TARGET_QT5 -DUSE_FILE32API -DCC_KEYBOARD_SUPPORT -D__QT__ -DCC_UNDER_QT -DCOCOS2D_DEBUG=1 -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -D_MSC_VER=1700 -D_WIN32 @debug/mocinclude.tmp ..\..\cocos\2d\platform\qt\CCApplication.h -o debug\moc_CCApplication.cpp

MOC ..\..\cocos\2d\platform\qt\CCApplication.h
1>  moc: Cannot open options file specified with @
1>  QCommandLineParser: argument list cannot be empty, it should contain at least the executable name

当我在命令行中删除@ debug / mocinclude.tmp并执行moc.exe时,它会生成我的文件。

这里有什么问题,我错过了什么?

1 个答案:

答案 0 :(得分:0)

我个人没有看到这个错误,但我使用Visual Studio构建了几个复杂的Qt程序。

moc.exe使用QCommandLineParser(自Qt 5.3起)决定如何处理参数列表。在Visual Studio构建程序时,它不知道如何处理@debug,因为@不属于文件名。当使用宏名称(例如$(Platform)$(Configuration))时,Visual Studio属性和批处理文件可以替换。当它在命令行上执行时,它将替换为宏所代表的实际文本。

http://msdn.microsoft.com/en-us/library/c02as0cs.aspx

希望有所帮助。