Problem Description
Errors encountered when compiling C library files with C++
/home/fa/chatbot/main.cpp:1321: undefined reference to `get_musicInfo_key(char*, char*)'
Cause Analysis
Because the compiler needs to be informed, C++ needs to tell the system to use the C compiler when linking and compiling C library files.
Solution
Add extern "C" { *** }
to inform , the example is as follows:
extern "C"{
#include "lib/mic_ring_buffer.h"
#include "lib/migu.h"
}