X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:from:date:message-id:subject:to :content-type; q=dns; s=default; b=Y/mFpJgcNp842/ivTuddkcnuWHNqd X6cQtZ7MyDUM4Y5SoMIobP3Ya7u2zEO6Fsx6csx7mJG1+845DpnRpAPf9oAhhh5q DCJX6lSWO/zPP//94hrcM+2PY2lYl6Jvvwe6DA0LltrmF7Xj4p7gE6WvCEKTV9QX K+5FQKZ61NMgbA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:from:date:message-id:subject:to :content-type; s=default; bh=ltCyHRFUQnEqvCi00qFgcxL518w=; b=G6o TnKRaOM5Boqivwafye56SHNjTF0jGWhNoom45QOwBIx/Yx5JohbboS9X2vR85Z0J Ro1jGO3ZN3+JkGQ3WgQ48qlkkW4QmTzfkPP6ACUp7Uxv8GqVz72xVaG329n80MqD bCqgGbT0zDOAfS9z6y0xJjLv28q09IjvWMNCV808= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=Giving, UD:dll, gplv3, clientid X-HELO: mail-lb0-f174.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-type; bh=KYPVb5b1uAVJAmGV2ax3z57MJ+SXtFyoorvd5Sfc2uc=; b=SJTPYGu7yw6ZEJEc33N+rgiwEnuPW4yblvXGel2oN5WMJORaHYhFiI+ZJV9BpMEfu1 BGWZwmtRKVBl2ZCvgr1uZZpPT49ZfvRzXkyi31kQawqKRnPlBVAfdvNxUQ6qSH5wkWE6 cPfosJq/0ilc3ST+ueZs5GCsaaVqNUHsWkpeagDepT4Q5F0jZtY56nGJrD4C7gUalJxY lVe4RMlZuamqDcgPxAEBSI5Ei8GXQcI4nizTzMFvhMfQ6tL3+gqP0P+x35bcX84T26+t fusZGlUahhPLzxji1Pm208GCh1m+zYRGUrJWsElO/+pqWXo/Lq99mflymQ2k6IYWAgJT 2GMw== X-Gm-Message-State: ALoCoQkcA1CwaRGUnvLixIrF08Q+RKWaIi7+ljpsIoWXmi3Uj9i1IzjWqLDfH65XNEvc0dP+iPSTLvv1esGVzenvE+LASiXDHQ== X-Received: by 10.112.125.198 with SMTP id ms6mr9123303lbb.106.1453138822084; Mon, 18 Jan 2016 09:40:22 -0800 (PST) MIME-Version: 1.0 From: stavros vagionitis Date: Mon, 18 Jan 2016 17:40:02 +0000 Message-ID: Subject: Re: No output from an executable when linked to a dll (both executable and dll build by me) To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes I did some debugging regarding the issue I had and next following some results. TL;DR: Giving executable permissions to the library, fixed the issue. So when I execute the binary file ./MQTTAsync_publish.exe, it terminates with exit code 127 $ ./MQTTAsync_publish.exe $ echo $? 127 I tried to use gdb in order to see if I could find more info regarding this problems. Using gdb I got the following $ gdb ./MQTTAsync_publish.exe GNU gdb (GDB) 7.8 Copyright (C) 2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-pc-cygwin". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from ./MQTTAsync_publish.exe...done. (gdb) run Starting program: /home/svagionitis/workspace/org.eclipse.paho.mqtt.c.git/build/output/samples/MQTTAsync_publish.exe [New Thread 6312.0x2798] During startup program exited with code 0xc0000022. (gdb) It seems that the program it's exiting with code 0xc0000022 before main. I just quickly googled this error and came across with [this issue](http://stackoverflow.com/questions/15911018/why-is-my-program-crashing-before-it-starts) which is a similar problem. I tried the [second answer](http://stackoverflow.com/a/27105757/619410), gave executable permissions to the library. During installation of the library, the makefile gave 0644(read/write) permissions only and not executable. Changing this to 755 (read/write/execute), I was able to run the ./MQTTAsync_publish.exe with no other problems. Regards, Stavros On Fri, Jan 15, 2016 at 5:27 PM, stavros vagionitis wrote: > Hi ppl, > > I have a problem when running an executable, it seems that is running > fine, but I don't get any output in the console. > > I need to build the [Paho MQQT > Client](https://eclipse.org/paho/clients/c/) in Cygwin. So I modified > the Makefile in order to build .dll instead of .so files. I have > attached the changes I made to the Makefile(Makefile_cygwin.patch). I > followed the instructions > [here](https://cygwin.com/cygwin-ug-net/dll.html) for the dll. > > The client comes with some sample applications, so I tried to run one > of them, MQTTAsync_publish.exe. I would expect to get the following > output (I run it in a linux box) > > $ Waiting for publication of Hello World! > $ on topic MQTT Examples for client with ClientID: ExampleClientPub > $ Connect failed, rc 0 > > but I don't get anything in the console and the application seems to > run without any other output or any indication. First I thought that I > hadn't linked correctly the dll, but I executed the following > > $ cygcheck.exe ./MQTTAsync_publish.exe > C:\cygwin64-fresh\home\svagionitis\workspace\org.eclipse.paho.mqtt.c.git\build\output\samples\MQTTAsync_publish.exe > C:\cygwin64-fresh\bin\cygwin1.dll > C:\Windows\system32\KERNEL32.dll > C:\Windows\system32\API-MS-Win-Core-RtlSupport-L1-1-0.dll > C:\Windows\system32\ntdll.dll > C:\Windows\system32\KERNELBASE.dll > C:\Windows\system32\API-MS-Win-Core-ProcessThreads-L1-1-0.dll > C:\Windows\system32\API-MS-Win-Core-Heap-L1-1-0.dll > C:\Windows\system32\API-MS-Win-Core-Memory-L1-1-0.dll > C:\Windows\system32\API-MS-Win-Core-Handle-L1-1-0.dll > C:\Windows\system32\API-MS-Win-Core-Synch-L1-1-0.dll > C:\Windows\system32\API-MS-Win-Core-File-L1-1-0.dll > C:\Windows\system32\API-MS-Win-Core-IO-L1-1-0.dll > C:\Windows\system32\API-MS-Win-Core-ThreadPool-L1-1-0.dll > C:\Windows\system32\API-MS-Win-Core-LibraryLoader-L1-1-0.dll > C:\Windows\system32\API-MS-Win-Core-NamedPipe-L1-1-0.dll > C:\Windows\system32\API-MS-Win-Core-Misc-L1-1-0.dll > C:\Windows\system32\API-MS-Win-Core-SysInfo-L1-1-0.dll > C:\Windows\system32\API-MS-Win-Core-Localization-L1-1-0.dll > C:\Windows\system32\API-MS-Win-Core-ProcessEnvironment-L1-1-0.dll > C:\Windows\system32\API-MS-Win-Core-String-L1-1-0.dll > C:\Windows\system32\API-MS-Win-Core-Debug-L1-1-0.dll > C:\Windows\system32\API-MS-Win-Core-ErrorHandling-L1-1-0.dll > C:\Windows\system32\API-MS-Win-Core-Fibers-L1-1-0.dll > C:\Windows\system32\API-MS-Win-Core-Util-L1-1-0.dll > C:\Windows\system32\API-MS-Win-Core-Profile-L1-1-0.dll > C:\Windows\system32\API-MS-Win-Security-Base-L1-1-0.dll > C:\cygwin64-fresh\usr\local\lib\cygpaho-mqtt3a.dll.1.0 > > and it seems that the library is there. I have installed all the > produced libraries in the /usr/local/lib and I have added the > /usr/local/lib to the PATH. > > I am not sure what might be the problem, is it something related to > the output or something else? I am open to any suggestions of how to > pinpoint the problem. > > Thank you in advance. > > Regards, > > Stavros > > P.S. I have attached the cygcheck.out for more info of the system. -- 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