It was very painful for me to associate a C ++ application with another C ++ library with Fortran90 dependencies (MinGW, TDM g ++, and gfortran). I either have to use gfortran for communication, or application crashes on startup (in global constructors bound to __cxa_get_globals_fast). However, this is unacceptable, I would like to use g ++ for linking (Qt GUI).
It seems to me that the library dependencies cannot be statically linked to gcc, the binding is performed only when main() . Why?
I think, in part because the code for some initializations should be inserted before main ().
Why does a statically linked application need DLL files such as mingwm10.dll or pthreadGCE2.dll at runtime? Why can't they be statically linked?
UPDATE: I just found these websites:
http://www.deer-run.com/~hal/sol-static.txt
http://www.iecc.com/linker/
source share