2014-01-23 76 views
1

我想通過在Cygwin shell內運行scons.bat來使用Visual Studio 2010 Express編譯C++項目。我在我應該運行Scons的文件夾中,但是我遇到了一個cl錯誤。這裏是我的輸出:使用Scons在Cygwin下編譯C++項目 - cl錯誤

The Citadel [email protected] /c/JTS/PracticeCode/PingComponent_120 
$ /c/Python27/Scripts/scons.bat 
scons: Reading SConscript files ... 
scons: Building for Windows... 
scons: done reading SConscript files. 
scons: Building targets ... 
cl /FoC:\JTS\jaustoolset-2.2.1 \GUI\templates\Common\Build\InternalEvents\InternalEventHandler.obj /c C:\JTS\jaustoolset-2.2.1\GUI\templates\Common\src\InternalEvents\InternalEventHandler.cpp /TP /nologo -DWIN32 -DWINDOWS /MD -EHsc -D_CRT_SE CURE_NO_DEPRECATE -DTIXML_USE_STL /I. /Iinclude /IC:\JTS\jaustoolset-2.2.1\GUI\templates\Common\include                  cl is not recognized as an internal or external command, 
operable program or batch file. 
scons: [C:\JTS\jaustoolset-2.2.1  \GUI\templates\Common\Build\InternalEvents\InternalEventHandler.obj] Error 1    
scons: building terminated because of errors. 

我曾嘗試在DOS命令提示符下設置環境變量運行vcvarsall.bat,但是這不那麼遠工作。

回答

0

好了,萬一別人是有我有同樣的問題,這裏是我做過什麼來解決這個問題:

我打開命令提示符爲Visual Studio(VS),去所在的目錄我的C++文件被找到了,並且運行了scons.bat(我還添加了scons.bat的路徑,所以我只需鍵入'scons.bat'而不是整個路徑名)。這會自動設置特定的環境變量,所以我可以使用命令行('cl')用VS創建C++文件。做完這些之後,我可以用SCons成功地構建我的項目。另外,我沒有使用Cygwin,而且我現在也不再用於當前的項目。我發現我可以用Windows命令提示符做所有我需要做的事情。