public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: No error messages printed out within Windows Command Prompt when shared libraries are not found
@ 2017-10-19 22:22 Luca
  0 siblings, 0 replies; 3+ messages in thread
From: Luca @ 2017-10-19 22:22 UTC (permalink / raw)
  To: cygwin


Sorry, I have just realized that the issue happens only when I use the "Windows Command Prompt" run by Total Commander (www.ghisler.com), while I correctly get the notification when using the "Windows Command Prompt" run from the Start Menu. This issue is actually related to Total Commander, so I am reporting it on the Total Commander forum.
--
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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: No error messages printed out within Windows Command Prompt when shared libraries are not found
  2017-10-17 21:41 Luca
@ 2017-10-17 22:31 ` Steven Penny
  0 siblings, 0 replies; 3+ messages in thread
From: Steven Penny @ 2017-10-17 22:31 UTC (permalink / raw)
  To: cygwin

On Tue, 17 Oct 2017 21:41:05, Luca wrote:
> If I run the program within the Windows Command Prompt, I do not get any er=
> ror messages (the program simply does not do anything).

Yeah, you do:

---------------------------
foo.exe - System Error
---------------------------
The program can't start because libfoo.dll is missing from your computer. Try
reinstalling the program to fix this problem.
---------------------------
OK
---------------------------

http://lut.im/qFIrHFkG6Y/LjKasGBjWeIeqOgY.png


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* No error messages printed out within Windows Command Prompt when shared libraries are not found
@ 2017-10-17 21:41 Luca
  2017-10-17 22:31 ` Steven Penny
  0 siblings, 1 reply; 3+ messages in thread
From: Luca @ 2017-10-17 21:41 UTC (permalink / raw)
  To: cygwin

On Linux, if I run a program compiled with 'gcc' without the proper shared libraries in path I get the following error message:

> error while loading shared libraries: libxxx.so: cannot open shared object file: No such file or directory

This is expected.

The same happens when running a program compiled with Cygwin on Windows, either using 'gcc' or 'x86_64-w64-mingw32-gcc', but only if I run the program within the Cygwin Terminal.

If I run the program within the Windows Command Prompt, I do not get any error messages (the program simply does not do anything).

Below are the instructions to reproduce the issue.


File 'foo.h':

#ifndef foo_h__
#define foo_h__
extern void foo(void);
#endif  // foo_h__


File 'foo.c':

#include <stdio.h>
void foo(void)
{
    puts("Hello, I'm a shared library");
}


File 'main.c':

#include <stdio.h>
#include "foo.h"
int main(void)
{
    puts("This is a shared library test...");
    foo();
    return 0;
}


Build object file 'foo.o':
x86_64-w64-mingw32-gcc -c foo.c

Build shared library 'libfoo.dll':
x86_64-w64-mingw32-gcc -shared -o libfoo.dll foo.o

Build executable 'foo.exe':
x86_64-w64-mingw32-gcc -o foo.exe main.c libfoo.dll

Rename shared library 'libfoo.dll':
mv libfoo.dll liberror.dll

If you run 'foo.exe' within the Cygwin Terminal you get the error message, if you run it within the Windows Command Prompt you do not get any messages printed out.
--
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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-10-19 22:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-19 22:22 No error messages printed out within Windows Command Prompt when shared libraries are not found Luca
  -- strict thread matches above, loose matches on Subject: below --
2017-10-17 21:41 Luca
2017-10-17 22:31 ` Steven Penny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).