No error messages printed out within Windows Command Prompt when shared libraries are not found
- Date: Tue, 17 Oct 2017 21:41:05 +0000
- From: Luca <lucatrv@xxxxxxxxxxx>
- Subject: No error messages printed out within Windows Command Prompt when shared libraries are not found
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.
extern void foo(void);
#endif // foo_h__
puts("Hello, I'm a shared library");
puts("This is a shared library test...");
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
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple