gcc: undefined reference to

However, avpicture_get_size is defined. No, as the header (<libavcodec/avcodec.h>) just declares it. The definition is in the library itself. So you might like to add the linker option to link libavcodec when invoking gcc: Please also note that libraries need to be specified on the command line after the files needing them: Not like this: Referring to Wyzard‘s comment, the complete command might look like … Read more

Undefined Reference issues using Semaphores

I am playing around with using Semaphores, but I keep encountering Undefined Reference warnings, thus causing my code not to work. I pulled example code from a text, but was having issues with some of their syntax, so I went to POSIX’s semaphore tutorial and changed things around to their syntax and as a result … Read more

C++ undefined reference to defined function

The declaration and definition of insertLike are different In your header file: void insertLike(const char sentence[], const int lengthTo, const int length, const char writeTo[]); In your ‘function file’: void insertLike(const char sentence[], const int lengthTo, const int length,char writeTo[]); C++ allows function overloading, where you can have multiple functions/methods with the same name, as long as they … Read more

What is an undefined reference/unresolved external symbol error and how do I fix it?

Compiling a C++ program takes place in several steps, as specified by 2.2 (credits to Keith Thompson for the reference): The precedence among the syntax rules of translation is specified by the following phases [see footnote]. Physical source file characters are mapped, in an implementation-defined manner, to the basic source character set (introducing new-line characters for end-of-line indicators) … Read more

What is an undefined reference/unresolved external symbol error and how do I fix it?

Compiling a C++ program takes place in several steps, as specified by 2.2 (credits to Keith Thompson for the reference): The precedence among the syntax rules of translation is specified by the following phases [see footnote]. Physical source file characters are mapped, in an implementation-defined manner, to the basic source character set (introducing new-line characters for end-of-line indicators) … Read more