【问题标题】:Getting started with C++ and Spotify APIC++ 和 Spotify API 入门
【发布时间】:2013-02-22 23:57:31
【问题描述】:

我决定通过实际使用 Spotifi 的 API 来开始学习 C++。

所以我下载了适合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]

这是我自定义的 sublime 构建配置:

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

我是否遗漏了构建过程中的任何步骤?

【问题讨论】:

标签: c++ compiler-construction sublimetext2 spotify


【解决方案1】:

您正在尝试链接 Makefile,由于它不是目标文件,因此会失败。您需要将其从构建过程中排除。

【讨论】:

  • 我在编辑器中打开了make文件并执行了构建,这不是你说的吗?
  • 您的设置中的某些内容使链接器尝试链接 Makefile,这是错误的。看起来您是在告诉 g++ 实际编译 Makefile 本身,但这是行不通的 - Makefile 告诉一个名为 make 的实用程序要给编译器什么 - 您实际上无法构建 Makefile。
  • 不知道您是否熟悉 spotify 的 C++ API 示例文件夹结构,但我已将其粘贴在这里:pastebin.com/VWWK0yQR 我知道我无法真正构建 Makefile,但我可以'除了打开Makefile并尝试构建之外,似乎没有想出另一种尝试构建项目的方法,就像我在文件夹根目录中尝试一样,我得到No such file or directory
  • 请原谅我的知识匮乏,我正在努力实现它
猜你喜欢
  • 1970-01-01
  • 2013-11-14
  • 1970-01-01
  • 1970-01-01
  • 2010-10-01
  • 2011-10-29
  • 2020-08-23
  • 1970-01-01
  • 2012-12-29
相关资源
最近更新 更多