views:

45

answers:

0

Hi!

I'm currently coding a small API to project thing onto a dome. To play video i use ffmpeg inside my display class (the core of the API).

When i compile a project ( I'm using kdevelop) with the .cpp and .h containing my class, the project work perfectly.

But i would like to made my class a .so for easy sharing and use.

I compile everything with this two command :

gcc -c -fPIC MyClass.cpp -o MyClass.o -lGLU -lGL -lglut `pkg-config --cflags --libs libavcodec libavformat libswscale` -lSDL -D __STDC_CONSTANT_MACROS

and then

gcc -shared -Wl,-soname,libMyLib.so.1 -o libMyLib.so.1.0.1  MyClass.o

It make fine, i got a libMyLib.so.1.0.1, rename it libMyLib.so, and then add -L. libMyLib to my make file of my project

But when i try to make it i got lots of undefined reference from ffmpeg functions inside my lib...and yes pkg-config --cflags --libs libavcodec libavformat libswscale is add in my compiler option of my project...

So what do i miss?