How to link against msvcr90.dll with mingw gcc? -
How can mingw link with GCs with msvcr90.dll? I tried - lmsvcr90, here's the least example:
#include & lt; Stdio.h & gt; Int main (int argc, const char * argv []) {printf ("% s \ n", "hello"); Return 0; }
My OS is win7, mingw gcc 4.5.0
$ gcc -v ... with GCC version 4.5.0 (GCC) $ GCC Hello.c -lmsvcr90 $ a
Then I found this error:
R6034
An app attempted to load Have the C runtime library incorrectly please contact the application's support team for more information.In which part I am missing?
edit1:
@ user440813 Looks like my mingow is very different from yours.
$ gcc hc -nostdlib -lmsvcr70 -lgcc -o h.exe d: / mingw / bin /../ lib / gcc / mingw32 / 4.5.0 / libgcc.a (__ main .o): (.text + 0x5a): Undefined reference to `atexit ': d: / mingw / bin /../ lib / gcc / mingw32 / 4.5.0 / libgcc.a (__ main.o) :( Text + 0xc2): `Entite 'collected 2: LD returned 1 exit status
Then I have
int atexit (zero (* function) (empty)) [return 0 ;}
and R6034 again ...
try Do
gcc hello.cnnostdlib -lmsvcr90 -lgcc -o hello.exe
instead. I'm a little surprised that your original collection attempt was successful, because there should be conflicting definitions between msvcr90
and msvcrt
(minu link by default). This way, it is linked in msvr90
, the conflicting msvcrt
is not added, but libgcc
is added to initialize the runtime library.
I do not have msvcr90.dll
on my computer, but I was able to verify that works with the analog signature msvcr100.dll
is.
Comments
Post a Comment