DllMain not called

Marco Atzeri marco.atzeri@gmail.com
Fri Feb 7 15:46:00 GMT 2020


Am 07.02.2020 um 16:07 schrieb Olivia Nelson:
> I compile it like this:
> gcc dll.c -shared -fPIC -o dll.dll
> 
> I tried to run it with LoadLibraryA
> 
> But DllMain is not called.
> 
> 

you are building a Cygwin dll, that requires the Cygwin1.dll
but probably do you not intend it and need a standalone one that
requires only the MS system dll's.

install the Mingw crosscompiler x86_64-w64-mingw32-gcc.exe
that is in the package

$ cygcheck -f /usr/bin/x86_64-w64-mingw32-gcc.exe
mingw64-x86_64-gcc-core-7.4.0-1

and compile as
x86_64-w64-mingw32-gcc.exe -Wall dll.c -shared -fPIC -o dll.dll

Regards
Marco

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list