the error is :
"
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.6.3/libgcc.a(__main.o): In function `_do_global_ctors':
/home/ruben/mingw-w64/toolchain/src/gcc/libgcc/../gcc/libgcc2.c:2164: undefined reference to `atexit'
collect2: ld returned 1 exit status
"
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The issue about using msvcr90 runtime is, that your application has to provide an manifest file. Either you can include it as resource into your application, or you can distribute the manifest-file next to your application.
Without this manifest, your built application rejects to start.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
How to link to msvcr90.dll use mingw-w64?
gcc hello.c -nostdlib -lmsvcr90 -lgcc -o hello.exe
the error is :
"
c:/mingw/bin/../lib/gcc/i686-w64-mingw32/4.6.3/libgcc.a(__main.o): In function `_do_global_ctors':
/home/ruben/mingw-w64/toolchain/src/gcc/libgcc/../gcc/libgcc2.c:2164: undefined reference to `atexit'
collect2: ld returned 1 exit status
"
You shouldn't be using "-nostdlib". That removes all MinGW-w64 support libraries. Just link with "-lmsvcr90" and you will get the desired result.
i use the following command
compling is fine.
run the hello.exe then error dialog appear with message " attempt to load the C runtime library incorrectly"
…..any idea???
Did you install the Microsoft redistributables?
32-bit: http://www.microsoft.com/download/en/details.aspx?id=5582
64-bit: http://www.microsoft.com/download/en/details.aspx?id=2092
Alternatively, you can redistribute the dll itself along the executable, but I don't know if the Microsoft licensing allows for that.
The issue about using msvcr90 runtime is, that your application has to provide an manifest file. Either you can include it as resource into your application, or you can distribute the manifest-file next to your application.
Without this manifest, your built application rejects to start.