I am trying to compile and link my project using g++. The source files in my project are written in c++, but the library I am trying to link against is written in c, and it doesn't have extern before the functions in the header files to define them as written in c language.
Here's my command for compiling and linking:
g++ socketd.cpp main.cpp -I src/common -L src/common -lwrappers -lerror -lpthread
I am getting the following errors:
socketd.cpp:(.text+0xc6): undefined reference to `error_sys(char const*, ...)'
And error_sys is already defined in liberror library.
So my question is, why am I getting this error? Is it because I have to re-write the functions and define extern before them for the libraries written in c language?
Thanks a lot.