www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/10/17/17:41:24

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:from:to:subject:date:message-id:content-type
:content-transfer-encoding:mime-version; q=dns; s=default; b=xii
afiXeCJRQji6UiXB5pWqXk+gsCjGx5tZMvlUD6OesQWBusFqlMo9oGmYQAbK8DXa
OuRsfMIGtGqngQmHuvKrZHp3CHsO4jW3HF/wAE1nh9jRNOdI3Sv9v6djPv7NqP7w
kjSsSaepB35ib9kCO6uVDeFoEFyqhdpNTp2LVO+8=
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:from:to:subject:date:message-id:content-type
:content-transfer-encoding:mime-version; s=default; bh=t6NkUyqoU
UU1SxRykxdzqZBT2Fw=; b=gb7cZDntV6wVO/s7YrsojcCv/9U5N5VxnHVK0/GD8
QdTIhYWG2sbVcf2L3z4DOPDrC2YCN6UttQr4qNoNsflCljtzWuBtx0pt6bW1chGv
MShamuse1rRD4zSExASbKsiXZAR4n+q34EnC+6SlmP+tYP6Q+7ehxFEhXmlW/Nuh
M4=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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.0 required=5.0 tests=BAYES_00,FORGED_HOTMAIL_RCVD2,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.2 spammy=UD:hotmail.com, hotmail.com, hotmailcom, Hauthentication-results:hotmail.com
X-HELO: EUR03-DB5-obe.outbound.protection.outlook.com
From: Luca <lucatrv AT hotmail DOT com>
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Subject: No error messages printed out within Windows Command Prompt when shared libraries are not found
Date: Tue, 17 Oct 2017 21:41:05 +0000
Message-ID: <HE1PR0901MB1658041282817A9F65B5B78BA44F0@HE1PR0901MB1658.eurprd09.prod.outlook.com>
x-incomingtopheadermarker: OriginalChecksum:82173281B6C2A05A24326BCD9EABE810BAE8B4747FA7E98D4C8CA1015C45A5D4;UpperCasedChecksum:B5C6CD5FE2BFEC4B05F38CFC720FE7F90B476C56627656AD10563CE6A0050541;SizeAsReceived:6993;Count:44
x-ms-exchange-messagesentrepresentingtype: 1
x-tmn: [WLy6swS9vze3Cm4t8lF2twZ6Af+ZYWJX]
x-ms-publictraffictype: Email
x-microsoft-exchange-diagnostics: 1;VE1EUR03HT083;6:QhtbuMdncURiA3PeSsmLbLlYrnn0AZ7niwVOJQv8ofMVJxHqYp38vwbSLLSp6r7j06DdDRhNRcl+SILzZallOxXjlxJCeMYBsOPPA6bpCsLYrq6H5tftReywOXY5IXwolFO6ubUsG4GDc4XvJwi8AQOJ6sK4aqsm4y7EqvX5+98n643yvYwWci8o0iqpPGILKc+7Ta1xO+VOgfPJ1y5YP6r/GTR82G1Ic1b6HUCfjqP2swK/MZ0liJ1ACcev38dwb3+VeeoZAC8/dYVUsyYfYQmE7HfoQhb3vytTKJGWeqRk+TrSRr6JlLHChXawQbbc5A/KRHDfxnuzeLCnSsvnuQ==;5:suq5v5PYhQsmLuOdT+lFr0j8PVhIV3FTo4QIrPYn2kGOQy7JyBok73DxgOJZ//szEq/G+Glp9vt7JbXwwjRNh6SxARLOxuwk/ZoPTmgHjD/ZQJ8oPclA/DzqGaFENrfnhGq+WxzbuNvet5hcewGgbQ==;24:VdP89NU+ZwhiYq+KIu0hjGj/+wTZqZwx955+Oo67OX3PNvRvPKSBlMqBYbhUK6mZMt4Wubnf/XjhgdSdgJVT5oPT7fvPunD5Ku9CDbAvc7w=;7:OM+vyN/HXxP18Fu8V3aFtGU++Drhf/UEOGvOSm/NU1eqyJ9B8wB1Ep49FiEMRG/cAAZXbJPFeEXMC46+ByEFMEcc6bgbBVUaA1UUP9/CJGICA83AJ4l24ppGyr/STv0/ygDxxPO9wouQWOOmePYyEg/JES8oW9mBGyORQZZlp7PoAT8sktPyujWnf9KUfhTpvZk/9dEuc6BrrEVGa17hCZExkkpIQpBh6kKHYfBxskI=
x-incomingheadercount: 44
x-eopattributedmessage: 0
x-ms-office365-filtering-correlation-id: 408fdeda-fc8a-45e1-051b-08d515a7c564
x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(201702061074)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031324274)(2017031323274)(2017031322404)(1601125374)(1603101448)(1701031045);SRVR:VE1EUR03HT083;
x-ms-traffictypediagnostic: VE1EUR03HT083:
authentication-results: outbound.protection.outlook.com; spf=skipped (originating message); dkim=none (message not signed) header.d=none; dmarc=none action=none header.from=hotmail.com;
x-exchange-antispam-report-test: UriScan:;
x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(444000031);SRVR:VE1EUR03HT083;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:VE1EUR03HT083;
x-forefront-prvs: 04631F8F77
x-forefront-antispam-report: SFV:NSPM;SFS:(7070007)(98901004);DIR:OUT;SFP:1901;SCL:1;SRVR:VE1EUR03HT083;H:DB6PR0901MB1653.eurprd09.prod.outlook.com;FPR:;SPF:None;LANG:;
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
MIME-Version: 1.0
X-OriginatorOrg: hotmail.com
X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Oct 2017 21:41:05.7556 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Internet
X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1EUR03HT083
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id v9HLfLaJ010732

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


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019