Basically I just found the solution. I place it here, because I didn't found such question in StackOverflow. Please answer if something of my positions are wrong.
I compile a library as a static library, but without correct #define
directive, all exported functions get a __declspec(dllexport)
prefix. So names of function function
became __imp_function
.
So, it was just an undefined reference to __imp_function
.
But why it is so encrypted? And why release build compiled correctly?
I believe that this happen because of -flto
option which does link time optimization and keep all the code of library inside .a file, so, no references needed (no fail).
-pthread
– Kraus