Undefined link, despite the link in the OpenFEC library

I get this problem when accessing OpenFEC (openfec.org) functions in my code:

anders@ubuntu :~/workspace/fectest$ gcc -L../openfeclib/ -l'openfec' -I../openfeclib fectest.cpp /tmp/ccEXLrdc.o: In function `main': fectest.cpp:(.text+0x17a): undefined reference to `of_create_codec_instance(of_session**, of_codec_id_t, unsigned char, unsigned int)' fectest.cpp:(.text+0x2db): undefined reference to `of_set_fec_parameters(of_session*, of_parameters*)' fectest.cpp:(.text+0x347): undefined reference to `of_build_repair_symbol(of_session*, void**, unsigned int)' fectest.cpp:(.text+0x395): undefined reference to `of_release_codec_instance(of_session*)' collect2: ld returnerade avslutningsstatus 1 

c files containing these functions are included in the openfec library.

nm ../openfeclib/libopenfec.so | grep of_release_codec team nm ../openfeclib/libopenfec.so | grep of_release_codec nm ../openfeclib/libopenfec.so | grep of_release_codec gives:

 000000000001a294 T of_release_codec_instance 

How to resolve this?

0
source share
1 answer

I was (finally !!) referring to the solution on the FFMpeg mailing list: http://ffmpeg.org/faq.html#I_0027m-using-FFmpeg-from-within-my-C_002b_002b-application-but-the-linker-complains -about-missing-symbols-which-seem-to-be-available_002e

Quote: "FFmpeg is a clean C project, so to use the libraries in your C ++ application, you need to explicitly indicate that you are using the C library. You can do this by including extern" C "in your FFmpeg."

I applied the same solution to my FFMpeg problem to the OpenFEC library problem.

+2
source

All Articles