error: LNK2019: unresolved external symbol “void __cdecl fun1(void)” (?fun1@@YAXXZ) referenced in function _main

Today, I add two c files(one is fun.c, the other is its header file fun.h) to a c++ project, because I want to call a function(fun1) residing in the C source file(fun.c) in a c++ source file (main.cpp) of the C++ project. Then the error occurs.

To view this content, you must be a member of Thomas's Patreon at $5 or more
Already a qualifying Patreon member? Refresh to access this content.

Leave a Reply