C++ 基于smpeg库的链接
我正在尝试用SDL和smpeg制作一个赤裸裸的媒体播放器。目前我仅有的代码如下:C++ 基于smpeg库的链接,c++,sdl,sdl-2,C++,Sdl,Sdl 2,我正在尝试用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") #pr
// 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 libs的链接错误,我尝试了以下链接命令:
-lSDL2_smpeg
-lSDL_smpeg
-lsmpeg
-libsmpeg
请注意,我已在我的软件包管理器中安装了我认为正确的LIB:
sudo apt-get install libsmpeg-dev
我应该如何以不同的方式链接它呢?在我的Debian伸缩框
libsmpeg dev
上,将smpeg.h
标题粘贴在/usr/include/smpeg/
中,而不是/usr/include/
因此,要么将-I/usr/include/smpeg/
传递到g++
,要么切换到\include
有关如何搜索头文件的信息,请参见