Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Message-ID: <3FB36D8F.9090807@cs.york.ac.uk>
Date: Thu, 13 Nov 2003 11:39:59 +0000
From: chris jefferson <caj@cs.york.ac.uk>
User-Agent: Mozilla Thunderbird 0.6 (Windows/20040502)
MIME-Version: 1.0
To: Christian Rudiger <christianruediger@gmx.net>
CC: cygwin@cygwin.com
Subject: [OT] Re: g++ libcygwin.a has an undefined reference
References: <c8cn3t$21u$1@sea.gmane.org> <00ae01c43cbf$d7d88d50$350aa8c0@pavilion> <c8cnvd$4bp$1@sea.gmane.org>
In-Reply-To: <c8cnvd$4bp$1@sea.gmane.org>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
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/

