This is the mail archive of the
mailing list for the Cygwin project.
Re: No output from an executable when linked to a dll (both executable and dll build by me)
- From: stavros vagionitis <stavros dot vagionitis at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Mon, 18 Jan 2016 17:40:02 +0000
- Subject: Re: No output from an executable when linked to a dll (both executable and dll build by me)
- Authentication-results: sourceware.org; auth=none
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
$ 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 <http://gnu.org/licenses/gpl.html>
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.
[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](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.
On Fri, Jan 15, 2016 at 5:27 PM, stavros vagionitis
> 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
> 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.
> P.S. I have attached the cygcheck.out for more info of the system.
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple