cancel
Showing results for 
Search instead for 
Did you mean: 

error undefined reference

Icont.1
Associate II

Good morning when compiling a project to which I added files (.h and.cpp) returns the error of "undefined reference" on a function that is in these files. I also add that I added other files (always .c and.h) of which I called a function without having problems.

2 REPLIES 2

Still a bit non-specific, what's the linker actually telling you, can you see the functions in the .MAP?

When mixing .C and .CPP​ files be aware of name mangling and linkage rules. Use use extern "C" or extern cdecl as appropriate.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Icont.1
Associate II

thanks