undefined reference to `__stack_chk_fail’

libgurobi_c++.a was compiled with -fno-stack-protector (obviously). A few things come to mind: add -fstack-protector when linking. This will make sure that libssp gets linked. Manually link -lssp Make your dummy version of __stack_chk_fail(void) in it’s own object file and and add this .o file to your linker command AFTER libgurobi_c++.a. GCC/G++ resolves symbols from left … Read more

Undefined reference to `initscr’ Ncurses

You need to change your makefile so that the -lncurses directive comes after your object code on the gcc command line, i.e. it needs to generate the command: gcc -W -Wall -Werror -Wextra -I./Includes/. -o Sources/NCurses/ncurses_init.o -c Sources/NCurses/ncurses_init.c -lncurses This is because object files and libraries are linked in order in a single pass.

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: -lavcodec Please also note that libraries need to be specified on the command line after the files needing them: gcc -I$HOME/ffmpeg/include … Read more

C error: undefined reference to function, but it IS defined

How are you doing the compiling and linking? You’ll need to specify both files, something like: gcc testpoint.c point.c …so that it knows to link the functions from both together. With the code as it’s written right now, however, you’ll then run into the opposite problem: multiple definitions of main. You’ll need/want to eliminate one … Read more

Undefined symbols “vtable for …” and “typeinfo for…”?

If Obstacle is an abstract base class, then make sure you declare all its virtual methods “pure virtual”: virtual void Method() = 0; The = 0 tells the compiler that this method must be overridden by a derived class, and might not have its own implementation. If the class contains any non-pure virtual functions, then … Read more

tech