compiling sfml c++ (ubuntu)
compiling sfml c++ (ubuntu)
我按照本教程安装 sfml 2.0 并且我在编译时遇到问题,我已经尝试了以下脚本的许多变体。我正在使用本教程中的代码。
这就是我尝试做的
g++ main.o -o -I/home/hassan/Development/sfml --this compile
然而
g++ main.o -o -L/home/hassan/Development/sfml/lib -lsfml-graphics -lsfml-window -lsfml-system
不
"/usr/bin/ld: 无法打开输出文件 -L/home/hassan/Development/sfml/: 没有这样的文件或目录"
谢谢
来自 "man g++":
-o file Place output in file file. This applies regardless to whatever sort of output is being produced, whether it be an executable file, an object file, an assembler file or preprocessed C code. (...)
g++ 的 -o 选项需要一个输出文件作为参数。所以在行
g++ main.o -o -L/home/hassan/Development/sfml/lib -lsfml-graphics -lsfml-window -lsfml-system
你告诉将可执行文件放入文件"-L/home/hassan/Development/sfml/lib"中,这实际上没有意义。尝试
g++ main.o -o sfml-app -L/home/hassan/Development/sfml/lib -lsfml-graphics -lsfml-window -lsfml-system
相关文章:
- 在Ubuntu 16.04上安装Cilk时出现问题
- 如何在Ubuntu中使用cmake设置qt4
- 链接阶段在Ubuntu上失败,但在MacOS上失败
- 无法将 GLFW 库与 Ubuntu 18.04 上的头文件链接
- 无法在Ubuntu上将共享库与Eclipse链接
- 树莓上的 Libtorch 无法加载 pt 文件,但在 ubuntu 上工作
- 无法安装 R 包 "nloptr"(Ubuntu 16.04 上的 R3.6.2) - C++编译器问题
- 使用 ubuntu 终端在 c++ 上运行线程类的问题
- 如何在 Ubuntu 上安装 OpenCV for C/C++
- 估计 Ubuntu C++内存使用情况
- 在 Ubuntu 中创建自动安装程序
- 分段 Linux Ubuntu 中的 g++ 错误,但在 Windows 中的 g++/MingW 中,在 C++ 中打
- OpenGL 在 VMWare Fusion 版本 10.1.3 上安装的虚拟机 (Ubuntu 16.04) 上崩溃
- 在 ubuntu 上安装 node js pulsar 客户端
- 在 Ubuntu 18.04 上编译 GLSL 着色器时"不支持 GLSL 3.30"?
- 这是 ubuntu 16.04 中的 gdb 错误吗?
- 生成文件:6:目标'all'的配方在 Ubuntu-16.04 上失败
- LinuxdeployQT 今天如何创建 Appimage,自 ubuntu 16.04 发布以来,它可以在每个 Lin
- 在 Ubuntu 服务器上运行 QT 应用程序时崩溃
- 在 ubuntu 18.04.3 LTS 上安装 Qt 和 qwt:如何连接它们?