2017-03-26 1 views
1

SDL 및 smpeg로 베어 본 미디어 플레이어를 만들려고합니다. 그러나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 년대와 연결 오류라고 생각 다음과 같이 현재 내가 가지고있는 유일한 코드는 libs와 나는 다음과 같은 연결 명령을 시도 :

-lSDL2_smpeg 
-lSDL_smpeg 
-lsmpeg 
-libsmpeg 

내가 내 패키지 관리자와 올바른 libs와 무슨 생각을 설치 한 것을 참고 :

sudo apt-get install libsmpeg-dev 

어떻게 다르게 연결해야합니까?

답변

1

데비안 스트레치 상자에 libsmpeg-devsmpeg.h 헤더를 /usr/include/이 아니라 /usr/include/smpeg/에 붙입니다.

따라서 -I/usr/include/smpeg/에서 g++으로 전달하거나 #include <smpeg/smpeg.h>으로 전환하십시오.

헤더 파일을 찾는 방법은 GCC C preprocessor documentation을 참조하십시오.

관련 문제