链接到 smpeg 库
Linking against smpeg library
我正在尝试使用 SDL 和 smpeg 制作准系统媒体播放器。目前我唯一的代码如下:
// Header file for SDL
#include "SDL.h"
// This is the header file for the library
#include "smpeg.h"
// Link in the needed libraries
#pragma comment( lib, "sdlmain.lib")
#pragma comment( lib, "sdl.lib")
#pragma comment( lib, "smpeg.lib")
#include "SDL_Movie.h"
int main(int argc, char* argv[])
{
return 0;
}
但是,当我尝试使用以下命令编译此代码时,出现错误:
g++ sdltest.cpp `pkg-config --clflags --libs sdl2` && ./a.out
Error is: fatal error: smpeg.h: No such file or directory
我相信这是 smpeg 库的链接错误,我已经尝试了以下链接命令:
-lSDL2_smpeg
-lSDL_smpeg
-lsmpeg
-libsmpeg
请注意,我已经使用我的包管理器安装了我认为正确的库:
sudo apt-get install libsmpeg-dev
我应该如何以不同的方式链接它或其他方式?
在我的 Debian Stretch 盒子上,libsmpeg-dev
将smpeg.h
标题粘贴在 /usr/include/smpeg/
中,而不是/usr/include/
。
因此,要么传入-I/usr/include/smpeg/
g++
,要么切换到#include <smpeg/smpeg.h>
.
请参阅 GCC C 预处理器文档,了解如何搜索头文件。
相关文章:
- lambda参数转换为constexpr技巧,然后获取带链接的数组
- CMake-按正确顺序将项目与C运行时对象文件链接
- 从链接列表c++中删除一个项目
- 有根的二进制搜索树.保留与其父级的链接
- 读取文件的最后一行并输入到链接列表时出错
- 静态数据成员的问题-修复链接错误会导致编译器错误
- node-gyp 在 macOS 上未正确链接库
- 基于boost的程序的静态链接——zlib问题
- 无法链接 CMake 中的本地库
- 内联函数中具有内部链接的全局变量
- 链接阶段在Ubuntu上失败,但在MacOS上失败
- 使用gcc从静态链接的文件中查找可选符号
- 我可以将一个用clang c++11编译的对象与另一个用c++17编译的对象链接起来吗
- 将--whole archive链接器选项与CMake和具有其他库依赖项的库一起使用
- 下面是我为检测链接列表中的循环而制作的代码
- 有了gcc,是否可以链接库,但前提是它存在
- 使用C链接在函数内部创建C++模板
- Visual Studio mkl_link_tool.exe链接错误
- 尝试链接我的着色器时,我收到错误代码"error c5145 must write to gl_position"
- 有人能帮我处理这个链接列表吗?C++