User forums > Using Code::Blocks
Linking ffmpeg
computerguy89:
Hi.
First of all I'm using Fedora 7 x86_64, Code::Blocks svn build 4407, wx2.8.4(Linux, unicode).
Okay I'm tying to get ffmpeg to link in my small little Video Player.
I've included avformat.a and avcodec.a. and avutil.a in the linker settings.
But it still fails to compile saying:
--- Code: ---ffmpeg/include/ffmpeg/avcodec.h:2243: warning: ‘ImgReSampleContext’ is deprecated (declared at ffmpeg/include/ffmpeg/avcodec.h:2237)
ffmpeg/include/ffmpeg/avcodec.h:2253: warning: ‘ImgReSampleContext’ is deprecated (declared at ffmpeg/include/ffmpeg/avcodec.h:2237)
obj/Debug/VideoStream.o:: In function `VideoStream':
Video/VideoStream.cpp:8: undefined reference to `av_register_all()'
Video/VideoStream.cpp:8: undefined reference to `av_register_all()'
Video/VideoStream.cpp:12: undefined reference to `av_open_input_file(AVFormatContext**, char const*, AVInputFormat*, int, AVFormatParameters*)'
Video/VideoStream.cpp:12: undefined reference to `av_open_input_file(AVFormatContext**, char const*, AVInputFormat*, int, AVFormatParameters*)'
Theres a lot more errors.
--- End code ---
Is there configure settings I have to include to get it to compile?
I compiled ffmpeg from svn because the one that come with the RPM failed to compile saying "error: ‘INT64_C’ was not declared in this scope".
So it could have got messed up there.
Any help would be vary much appreciated.
wwolf:
Do you have the actual command line that printed the linker errors? Then we could see if the problem is Code::Blocks related or not.
computerguy89:
Sorry, But how do you get that?
I'm still a little new to Code::Blocks.
computerguy89:
Never mind I figured it out.
Here it is:
--- Code: ---g++ -L/usr/lib -o bin/Debug/VideoPlayer obj/Debug/Main.o obj/Debug/VideoStream.o ffmpeg/lib/libavcodec.a ffmpeg/lib/libavformat.a ffmpeg/lib/libavutil.a
--- End code ---
I have ffmpeg installed in my projects directory.
Is this what you wanted?
wwolf:
Yes! Thanks. Now I am not familiar with ffmpeg on Linux, but I think that you may need to put the whole path into the -L option. I say may, because I am not sure. And my Linux box has just disappeared from the Net, so I cannot test it either. :(
What you may want to try is to go to command line (shell) and cd to the directory where Code::Blocks does the build, and try different alternatives of the above linker command line. Like adding the full path into the -L and removing it from the -l. In that way you can figure out what works, without the need to open and close dialog boxes. Once you figure out how you can link without errors, you can put the final stuff back into the relevant Code::Blocks settings and it should work there, too.
I know this is not exactly much help, but right now this is all I can offer. :(
Navigation
[0] Message Index
[#] Next page
Go to full version