Skip to main content
Icont.1
Associate III
November 2, 2021
Question

error undefined reference

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.

    This topic has been closed for replies.

    2 replies

    Tesla DeLorean
    Guru
    November 2, 2021

    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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Icont.1
    Icont.1Author
    Associate III
    November 3, 2021

    thanks