delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/05/18/06:39:49

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
Message-ID: <3FB36D8F.9090807@cs.york.ac.uk>
Date: Thu, 13 Nov 2003 11:39:59 +0000
From: chris jefferson <caj AT cs DOT york DOT ac DOT uk>
User-Agent: Mozilla Thunderbird 0.6 (Windows/20040502)
MIME-Version: 1.0
To: Christian Rudiger <christianruediger AT gmx DOT net>
CC: cygwin AT cygwin DOT com
Subject: [OT] Re: g++ libcygwin.a has an undefined reference
References: <c8cn3t$21u$1 AT sea DOT gmane DOT org> <00ae01c43cbf$d7d88d50$350aa8c0 AT pavilion> <c8cnvd$4bp$1 AT sea DOT gmane DOT org>
In-Reply-To: <c8cnvd$4bp$1@sea.gmane.org>
X-IsSubscribed: yes

Christian Rudiger wrote:

> Hello Al,
>
> thank you, it worked.
> i putted one at the end of the program just writing :
>
> }; // end of class
> int main(){}
>
> why does that work? I think thats strange.
>
> Regards Christian Rudiger

<snip>

I thought I would post this to the list, because it's nice to have 
complete dicussions for archive reasons.

All programs in standard C++ should have a function called main 
(sometimes this function has a different name, for example in windows 
GUI programming I believe it is called WinMain). This is the function 
which is called when your program starts, and so must be present. I 
suspect you are perhaps coming from a java background and may be 
misunderstanding program structure in C++. This is however unrelated to 
cygwin, so will not be discussed further. You perhaps need to go and get 
a book or guide to c++?

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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