2013-03-06 134 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'

相關問題