Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

[SOLVED] Compiling library by gcc and g++



  • Hello. I created simple qt5 project containing main.c only and using library lib.a. It compiles by gcc successfully. But if i will rename file to main.cpp and will try to compile it by g++, I will get linker "undefined reference" error. No library source code provided. Is there any way to compile projects by g++? Thanks



  • Adding "extern "C"" before function's declarations in header solves the problem


Log in to reply