X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B9D3C3853809 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1645191082; bh=ivx4Kc4izUqfmvkPZ6tmwKVVErO7nYktWeqEIuKihmA=; h=To:Subject:Date:References:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=I05Fh8F3vWCe8681SCJF1RKzetzbe/aFbAJmKeldGqpc/+51+IzXiGAU8Q/ikZj05 9l+Evab5xHMn+Q/4Sa7s8CF5rGKjHse3Qd3nvl1CYoemydxEA4tRYriiEr4CfH6fW8 0btu2FAgav0fQJa8iIaexgHttsxSeEq8KU8t8td8= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7B2BB385801A X-Injected-Via-Gmane: http://gmane.org/ To: cygwin AT cygwin DOT com Subject: Re: [PATCH] Fix optional variables in libargp Date: Fri, 18 Feb 2022 08:30:05 -0500 Message-ID: References: <000001ce7e08$2b866830$82933890$%fedin AT samsung DOT com> <4q4ut8had25hqmo8b0752i8asuv6ism2qh AT 4ax DOT com> <002901ce7f0a$9da99420$d8fcbc60$%fedin AT samsung DOT com> <002601ce82b7$63229580$2967c080$%fedin AT samsung DOT com> <002a01ce86c6$ba32a190$2e97e4b0$%fedin AT samsung DOT com> Mime-Version: 1.0 X-Newsreader: Forte Agent 4.2/32.1118 X-Archive: encrypt X-Spam-Status: No, score=-3032.2 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.29 List-Id: General Cygwin discussions and problem reports List-Archive: List-Post: List-Help: List-Subscribe: , From: Andrew Schulman via Cygwin Reply-To: Andrew Schulman Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Cygwin" > Hello! > I have successfully tested it on i386. Really, just remove PREFIX > completely and it's okay. GetProcAddress() appears to be "clever" and adds > the leading underscope by itself on i386. I don't know what you did wrong > and why you could not reproduce the solution. > However, i have one idea. After patching libargp you need to recompile your > test case. Because it needs to pick up __declspec(dllexport). Yes, I recompiled my example after rebuilding and reinstalling libargp. It still doesn't work. I even rebooted too, to make sure I was using the newly installed cygargp-0.dll and not a cached version. I don't know why this should work for you, and not for me. I'm attaching here the revised patch of yours with PREFIX removed, and the argp-ex2.c source file that I'm building. Using this patch, I rebuild and reinstall libargp. Then I get $ gcc -o argp-ex2 argp-ex2.c -largp $ ./argp-ex2.exe --help Usage: argp-ex2 [OPTION...] Argp example #2 -- a pretty minimal program using argp -?, --help give this help list --usage give a short usage message Note there's no --version option or bug reporting email address. Do you get a different result? -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple