This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: No output from an executable when linked to a dll (both executable and dll build by me)

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 $?

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:
[New Thread 6312.0x2798]
During startup program exited with code 0xc0000022.

It seems that the program it's exiting with code 0xc0000022 before
main. I just quickly googled this error and came across with [this
which is a similar problem. I tried the [second
answer](, 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.



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]( 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]( 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:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]