c++ undefined reference to mysqlinit Solved g++ $(mysql_config --cflags) file.cpp -o filename $(mysql_config --libs)