2013-02-22 45 views
0

我決定開始通過Spotifi的API實際工作一點點來開始學習C++。C++和Spotify API入門

所以我下載了windows環境的正確文件,並設置了MinGW來使用它進行編譯。

現在,一切都設置,我加載一個Sublime2項目Spotify的-examples文件夾和運行構建,但問題是,我似乎無法通過以下錯誤:

c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe:D:\W0RK\Software\spotify-examples\Makefile: file format not recognized; treating as linker script 
c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe:D:\W0RK\Software\spotify-examples\Makefile:1: syntax error 
collect2.exe: error: ld returned 1 exit status 
[Finished in 0.4s with exit code 1] 

這是我的自定義崇高構建配置:

{ 
    "cmd": ["C:\\MinGW\\bin\\mingw32-g++.exe", "-Wall", "-time", "--verbose", "$file", "-o", "$file_base_name"] 
} 

我失去了在建設過程中的任何一步?

+0

這是我其實也必須做的:http://stackoverflow.com/questions/5214820/how-to-use-a-makefile-for-mingw-on-win32 – Alex 2013-02-27 01:24:54

回答

1

您正在嘗試鏈接Makefile,由於它不是目標文件,所以會失敗。您需要從構建過程中排除它。

+0

我打開了make文件編輯和執行的版本,不是你在說什麼? – Alex 2013-02-23 10:27:22

+0

您的設置中的某些內容正在使鏈接器嘗試鏈接Makefile,這是錯誤的。看起來你正在告訴g ++實際編譯Makefile本身,這是行不通的 - Makefile告訴一個名爲'make'的實用程序要給編譯器什麼 - 你實際上不能建立一個Makefile。 – iKenndac 2013-02-23 10:46:33

+0

不知道您是否熟悉spotify的C++ API示例文件夾structer,但我已將它粘貼到此處:http://pastebin.com/VWWK0yQR我知道我無法輕鬆構建Makefile,但我無法似乎想通過另一種方式嘗試構建項目,除了打開Makefile並嘗試構建,就好像我嘗試在文件夾根目錄中一樣,我得到'沒有這樣的文件或目錄' – Alex 2013-02-24 23:15:39