[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
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.