vc6.0中產生的makefile問題

來源:互聯網
上載者:User

最近看《Windows程式設計》,1.3.6有講解產生make file

產生方法:VC6.0菜單“工程”--匯出make file,這樣在工程目錄下就會產生 “工程名.mak”檔案

下面以第一章的HelloMsg為例講解vc6.0產生的make file存在的問題

產生HelloMsg.mak後,開啟命令列,跳到HelloMsg.mak目錄,執行以下命令

NMAKE /f HelloMsg.mak CFG="HelloMsg - Win32 Debug"

但這時會發現mak檔案有錯誤

HelloMsg.mak(1) : fatal error U1023: syntax error in expression Stop.

使用UltraEdit開啟HelloMsg.mak檔案

# Microsoft Developer Studio Generated NMAKE File, Based on HelloMsg.dsp

!IF $(CFG)" == "

CFG=HelloMsg - Win32 Debug

!MESSAGE No configuration specified. Defaulting to HelloMsg - Win32 Debug.

..............

!ERROR An invalid configuration is specified.

!ENDIF 

!IF $(OS)" == "Windows_NT

NULL=

!ELSE 

NULL=nul

!ENDIF 

注意mak檔案中的紅色部分,將其修改如下

# Microsoft Developer Studio Generated NMAKE File, Based on HelloMsg.dsp

!IF "$(CFG)" == "CFG=HelloMsg - Win32 Debug"

CFG=HelloMsg - Win32 Debug

!MESSAGE No configuration specified. Defaulting to HelloMsg - Win32 Debug.

.............

!ERROR An invalid configuration is specified.

!ENDIF 

!IF "$(OS)" == "Windows_NT"

NULL=

!ELSE 

NULL=nul

!ENDIF 

再次在命令列執行命令

NMAKE /f HelloMsg.mak CFG="HelloMsg - Win32 Debug"

這次發現命令沒有任何問題,運行完後會在命令列目前的目錄下產生Debug檔案夾,裡面有可執行檔!

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.