2013-03-06 130 views
2

我被要求使用msbuild来构建一个基于qt的解决方案文件。我尝试使用下面的命令,并且我最终得到一个错误。我能够构建一个wix项目使用相同的命令如下所示。在windows 32位系统上使用msbuild构建一个解决方案文件

C:\Windows\Microsoft.NET\Framework\v4.0.30319>MSBuild "C:\path\to\my solution file\my.sln" /t:Build /p:Configuration=Release /p:Platform=Win32 

有了这些,我得到一个错误说,

C:\Program Files\MSBuild\Microsoft.CppCommon.targets(155,5): 
error MSB6006: "cmd.exe" exited with code 3. [c:\my\path to\project file\my.vcxproj] 

的my.vcxproj各种文件的路径不被系统读取时Moc'ing.I得到下面的错误

InitializeBuildStatus: 
    Touching "Win32\Release\my.unsuccessfulbuild". 
CustomBuild: 
    Moc'ing "dialog.h"... 
    The system cannot find the file path specified 
    Moc'ing "Centralwidget.h"... 
    The system cannot find the file path specified 

等等....

我曾试图建立使用QMAKE过,但没有succeeded.Looking˚F orward的好建议,对于哪一种方法提前

+0

里面有什么'my.vcxproj'?将.vcxproj中的相关部分添加到您的问题中,以及MSBuild生成的错误消息的详细输出。 – 2013-03-07 15:51:55

回答

1

建设使用的MSBuild一个Qt解决方案文件用来构建一个基于Qt的解决方案file.Thanks,

def buildsolution(self,solutionpath): 
    if not os.path.isfile(self.msbuild): 
     raise Exception('MSBuild.exe not found. path=' + self.msbuild) 
    arg1 = '/t:Rebuild' 
    arg2 = '/p:Configuration=Release' 
    arg3 = '/p:Platform=Win32' 
    proc = subprocess.Popen(([self.msbuild,solutionpath,arg1,arg2,arg3]), shell=True, 
        stdout=subprocess.PIPE) 
    while True: 
     line = proc.stdout.readline()       
     wx.Yield() 
     if not line: break 
    proc.wait() 

其中self.msbuild = R'C: \的Windows \ Microsoft.NET \框架\ v4.0.30319 \ MSBuild.exe 'solutionpath = r'path到\ qt的解决方案文件\ my.sln'

相关问题