X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,SPF_HELO_PASS,T_RP_MATCHES_RCVD,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com connect(): No such file or directory From: Kurt Franke Subject: Re: Using main() from a shared library in Cygwin 1.7 Date: Fri, 14 May 2010 12:13:11 +0000 (UTC) Lines: 30 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit User-Agent: Loom/3.14 (http://gmane.org/) X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Ferenc Kovacs gmail.com> writes: ... > I have an application, which links with a shared library (fairly common > situation :)). This shared library provides the main() function. This > approach works well on Linux/Solaris machines, but on Cygwin 1.7 > I get the following link error: ... Hi Ferenc, some years ago I had a problem with main function in a library under VMS The linker just didn't search for it in a library. To force it to search a reference in a non-library part of source did help. I just added the following code in the main source file: extern int main(); static int (*force_linker_search_for_main_in_library)() = main; maybe something similar will help you regards kf -- 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