c++ - SDL 和 g++ 总是产生错误?

标签 c++ compiler-construction compiler-errors g++ sdl

我想我已经正确安装了 SDL,但我找不到一种方法来检查 import Pygame 在 python 中。我正在使用 Ubuntu 13.04。这是我的 C++ 代码 #include "SDL/SDL.h" 中的 header 。当我在代码目录中运行 g++ -Test -o "testcode""lesson02.cpp" 时,我得到 /usr/bin/ld: cannot open linker script file est: No such file 或目录。我正在尝试遵循 lazy Foo 的教程,但并未真正涵盖编译,我迷路了。我是否需要在我的编译命令中编写其他内容以包含 SDL? SDL 是否未正确安装?我的包含行有问题吗?

最佳答案

您应该将 -lsdl 添加到您的 g++ 选项中。

编辑:真正的解决方案是删除 -Test 选项,因为 g++ 将其视为“加载名为 est 的脚本文件”。

关于c++ - SDL 和 g++ 总是产生错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17769091/

相关文章:

c++ - 交换和 move 无限递归

c++ - 输出除法结果包括小数点后的数字-Qt

C++ 嵌套 Lambda

scala - 向编译器请求有关@inline 的更多信息?

compiler-construction - 使用 llvm 库构建时如何链接?

c++ - 错误 C2593 : 'operator =' is ambiguous

compiler-errors - 错误:near “initial” : syntax error, unexpected initial [closed]

c++对象创建相同类型的新实例

GWT编译代码优化

linux - 错误: bad instruction 'rfe lr' arm cross compiler