I'm trying to build dll on WinNT platform usign gcc under cygwin, that aftewards will be used in MSVC. I wrote small example with just one function :
__declspec(dllexport) __stdcall int foo();
na built a dll from it using following command :
gcc -c dll_main.c -o dll_main.o
gcc -Wl,--out-implib,dll.a -shared -o dll.dll dll_main.o
afterthat I built a project in VS with only one file looking :
__declspec(dllimport) int __stdcall foo();
and compiled it with dll.a. Everything was fine, compilation succed.
But now I have a problem, when I'm executing it, it falls with exception. Debugging shows that call to foo points to some uninitialized memory.
If someone knows how to solve it, please answer.