Top "Undefined-reference" questions

A linker error caused by a missing definition of a symbol used elsewhere in a program

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

What are undefined reference/unresolved external symbol errors? What are common causes and how to fix/prevent them? Feel free …

c++ linker-errors undefined-reference c++-faq unresolved-external
libpthread.so.0: error adding symbols: DSO missing from command line

When I'm compiling openvswitch-1.5.0, I've encountered the following compile error: gcc -Wstrict-prototypes -Wall -Wno-sign-compare -Wpointer-arith -Wdeclaration-after-statement -Wformat-security -Wswitch-enum -Wunused-parameter -Wstrict-aliasing …

gcc compiler-errors linker undefined-reference
C error: undefined reference to function, but it IS defined

Just a simple program, but I keep getting this compiler error. I'm using MinGW for the compiler. Here's the header …

c function linker-errors undefined-reference
Undefined Reference to

When I compile my code for a linked list, I get a bunch of undefined reference errors. The code is …

c++ undefined-reference
Undefined reference to `pow' and `floor'

I'm trying to make a simple fibonacci calculator in C but when compiling gcc tells me that I'm missing the …

c gcc undefined-reference
gcc: undefined reference to

I would like to compile this. program.c #include <libavcodec/avcodec.h> int main(){ int i = avpicture_get_…

c++ c gcc linker undefined-reference
Undefined reference to `sin`

I have the following code (stripped down to the bare basics for this question): #include<stdio.h> #include&…

c math linker-errors undefined-reference
C++ undefined reference to defined function

I cannot figure out why this is not working. I will put up all three of my files and possibly …

c++ g++ undefined-reference
DSO missing from command line

I am trying to compile a C++ program like this: $ g++ -o Sniffer_Train main.cpp Sniffer_train.cpp Sniffer_…

c++ linux g++ undefined-reference
Undefined reference to sqrt (or other mathematical functions)

I have this simple code: max = (int) sqrt (number); and in the header I have: #include <math.h> …

c linker-errors undefined-reference