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

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