1.最近重裝了vs2012專業版
2.我的cl目錄為“E:\Microsoft Visual Studio 11.0\VC\bin”
test.cpp為一個hello world的程式
編譯出現這樣的警告:
F:\gts>cl test.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 17.00.50727.1 for x86
Copyright (C) Microsoft Corporation. All rights reserved.
cl : Command line warning D9024 : unrecognized source file type 'E:\Microsoft', object file assumed
cl : Command line warning D9024 : unrecognized source file type 'Visual', object file assumed
cl : Command line warning D9024 : unrecognized source file type 'Studio', object file assumed
cl : Command line warning D9024 : unrecognized source file type '11.0\VC\bin', object file assumed
test.cpp
Microsoft (R) Incremental Linker Version 11.00.50727.1
Copyright (C) Microsoft Corporation. All rights reserved.
接著鏈接的時候出現這樣的錯誤:
/out:Microsoft.exe
E:\Microsoft
Visual
Studio
11.0\VC\bin
test.obj
LINK : fatal error LNK1181: cannot open input file 'E:\Microsoft.obj'
【導致我能生成test.obj檔案,但是無法鏈接。感覺編譯器和連接器把自己的路徑作為引數了,還因為路徑的空格分隔成幾個引數!】
另:在VS里面(點綠色箭頭)我能正常編譯鏈接程式。
再另:因為一個開源的專案(作者提高了cmake的檔案)我需要本地編譯,所以必須用到cl,沒法子用VS。
uj5u.com熱心網友回復:
補充一下,cmake專案的時候因為無法通過一個測驗例子的編譯,所以整個生成程序就中斷了。應該是上面這個問題導致的。轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/91549.html
