public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Marco Atzeri <marco.atzeri@gmail.com>
To: cygwin@cygwin.com
Subject: Re: DllMain not called
Date: Fri, 07 Feb 2020 15:46:00 -0000	[thread overview]
Message-ID: <101a7ee1-5ee3-78af-1c1f-ac8b7d97c49b@gmail.com> (raw)
In-Reply-To: <CAJZVxR=gFdeYeZYorqmxOL_BKXcrO22EqsMbteD-h+qT9igngg@mail.gmail.com>

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

  reply	other threads:[~2020-02-07 15:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-07  8:47 Olivia Nelson
2020-02-07 14:49 ` Marco Atzeri
2020-02-07 15:07   ` Olivia Nelson
2020-02-07 15:46     ` Marco Atzeri [this message]
2020-02-07 18:19     ` Joost Kraaijeveld
2020-02-07 19:10     ` Joost Kraaijeveld
2020-02-08  0:12       ` DllMain not called in CreateRemoteThread Olivia Nelson
2020-02-08  5:40         ` Marco Atzeri
2020-02-09 14:52           ` Olivia Nelson
2020-02-10 18:50             ` Andrey Repin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=101a7ee1-5ee3-78af-1c1f-ac8b7d97c49b@gmail.com \
    --to=marco.atzeri@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).