From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 107022 invoked by alias); 7 Feb 2020 15:46:45 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 106948 invoked by uid 89); 7 Feb 2020 15:46:38 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=H*f:sk:c9486fc, dlldll, H*f:sk:gFdeYeZ, UD:dll.dll X-HELO: mail-wr1-f48.google.com Received: from mail-wr1-f48.google.com (HELO mail-wr1-f48.google.com) (209.85.221.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 07 Feb 2020 15:46:37 +0000 Received: by mail-wr1-f48.google.com with SMTP id z3so3264225wru.3 for ; Fri, 07 Feb 2020 07:46:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=G/DFspE5BHXpOVFvmRMwUoNKYMLgOZPzXvcrRebLaxM=; b=AZFFQR2e33hzjpirGV7LeGDB+EtB38B2YIE9IV4NU4VNUc1lUZH7kLFK9KLeCYd7GU teJDs+j90ylMgfhjlj/ixFfjSb4Emly6umypDa83AZQkCWBU/bDhl+i/g7VC/rRw4nWK /zYF4hY7ry1A1yxIdsgyxHVjSSPA8+Zut2WPhp7+Cwk65UdwiGiJUwOFU59pgjWw076g aik19gsisftcfDD1o+FGSlb9jBo1H7Ghk/HS9DHxbpkW8M+pr3e7JAI82JY+2Al9ZzMf IBdre9sy4ZcXAHjYgKGoQLGZthOfu7I/75hZJnW0z0LbiJl+kDL3kQghu/dS2mxs5Lsd YlcA== Return-Path: Received: from ?IPv6:2003:ee:6727:2e01:a538:71e4:6454:c4e0? (p200300EE67272E01A53871E46454C4E0.dip0.t-ipconnect.de. [2003:ee:6727:2e01:a538:71e4:6454:c4e0]) by smtp.gmail.com with ESMTPSA id x132sm17522696wmg.0.2020.02.07.07.46.33 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 07 Feb 2020 07:46:34 -0800 (PST) Subject: Re: DllMain not called To: cygwin@cygwin.com References: From: Marco Atzeri Message-ID: <101a7ee1-5ee3-78af-1c1f-ac8b7d97c49b@gmail.com> Date: Fri, 07 Feb 2020 15:46:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2020-02/txt/msg00051.txt.bz2 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