On 24.05.2011 at 11:47, MacArthur, Ian (SELEX GALILEO, UK) wrote: > >>> I have never had problems with the DLL and mingw (Though I >> do not use it >>> all that much now.) >>> Have I just been lucky, or is it actually different in this respect? >> >> I *believe* yes. I think that the MinGW runtime doesn't call WinMain() >> at program initialization, but calls main() directly, so >> there shouldn't >> be a problem. But I could be wrong with this, I can't tell for sure. > > I do not know how to tell...
Hmm, is this simple test conclusive? MinGW $ cat main.c int main (int argc, char **argv) { return 0; } MinGW $ gcc -o main main.c ; ./main ; echo $? 0 MinGW $ gcc -mwindows -o main main.c ; ./main ; echo $? 0 There is no WinMain() in the test program, and it can be linked and runs w/o error. Ah, no, this works as well: MinGW $ cat main1.c #include <Windows.h> int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { return 1; } MinGW $ gcc -mwindows -o main1 main1.c ; ./main1 ; echo $? 1 *MAGIC* ;-) [ fluid linking and command lines skipped ] > And here is what nm makes of the result (I don't know how else to get > dependencies out of the exe under win32!) Cygwin's cygcheck program (a native Windows exe) is good for this: MinGW $ cygcheck ./main.exe .\main.exe C:\WINDOWS\system32\KERNEL32.dll C:\WINDOWS\system32\ntdll.dll C:\WINDOWS\system32\msvcrt.dll MinGW $ cygcheck ./main1.exe .\main1.exe C:\WINDOWS\system32\KERNEL32.dll C:\WINDOWS\system32\ntdll.dll C:\WINDOWS\system32\msvcrt.dll (Note that I add the Cygwin bin directory to my PATH for such usage). There is also "dependency walker", but I never used it. http://en.wikipedia.org/wiki/Dependency_Walker And finally I believe that sysinternals (now Microsoft) has a tool as well, but I don't know (again). http://en.wikipedia.org/wiki/Sysinternals Albrecht _______________________________________________ fltk-dev mailing list fltk-dev@easysw.com http://lists.easysw.com/mailman/listinfo/fltk-dev