Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 Message-ID: <02ef01c38ecb$f51d4fb0$db406682@itee.uq.edu.au> Reply-To: "Kai Xu \(Kevin\)" From: "Kai Xu \(Kevin\)" To: Subject: Re: undefined reference to 'class::function' error Date: Fri, 10 Oct 2003 11:15:13 +1000 Organization: ITEE, The Univeristy of Queensland MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Spam-Checked: This message probably not SPAM X-Spam-Score: -0.5 X-Spam-Tests: QUOTED_EMAIL_TEXT X-Spam-Report: -0.50 points, 8 required; * -0.5 -- BODY: Contains what looks like a quoted email text X-Scanned-By: MIMEDefang 2.35 Note-from-DJ: This may be spam Yes, indeed! I get it working and thank you so much! That's what I used to do when program c++ under windows, but seems not the right way for UNIX. I will send email to list after this one :-) Kevin > ----- Original Message ----- > From: "Igor Pechtchanski" > To: "Kai Xu (Kevin)" > Cc: > Sent: Friday, October 10, 2003 10:57 AM > Subject: Re: undefined reference to 'class::function' error > > > > Kevin, > > > > Please don't Cc: me, I read the list (I set the Reply-To: for a reason). > > More below. > > > > On Fri, 10 Oct 2003, Kai Xu (Kevin) wrote: > > > > > As I am not good at c++, I am not sure what you mean by "link the file > that > > > defines this function into the resulting executable". I just include the > .h > > > file that defines the function in the main .cpp file. The compile > command I > > > used is: > > > > > > g++ sp.cpp (the main cpp file) > > > > > > I guess there could be some problem here. > > > > > > Kevin > > > > Aha, so you aren't linking the file in. This is a general C/C++ question, > > not Cygwin specific, and thus off-topic for this list. For more details, > > read up on "separate compilation" and "multiple source files" in any C/C++ > > book. For a short term solution, simply add the cpp file that defines the > > missing function to the compile command, but if you need further help on > > similar issues, please try a C/C++ user support list/newsgroup or read > > an intro to programming book. > > Igor > -- 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/