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 to right during linking so despite your code having the function defined, a copy of an object containing the __stack_chk_fail symbol needs to be on the linker line to the right of libgurobi_c++.a.