LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-16-2009, 02:04 PM   #1
Len Tyree
Member
 
Registered: May 2008
Location: An American in Thailand
Distribution: Ubuntu 9.10 (of course)
Posts: 37

Rep: Reputation: 15
C++ problem? Geany in UBUNTU 8.10


i am attempting to learn c++ using "sams teach yourself c++ for linux in 21 days", am doing ok, but ran into a problem at day 8, listing 8.5 and beyond. the code is:
class SimpleCat
{
public:
SimpleCat();
~SimpleCat();
private:
int itsage;
}

SimpleCat::SimpleCat()
// error: new types may not be defined in a return type??? Like book!!
{

do not know how to get around this error??

a little help, please? Thanks, len tyree.

p.s. sent the same message to ubuntu forum.
 
Old 01-16-2009, 02:40 PM   #2
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Looks like a very common error: Missing the ; after the } at the end of the definition of a class.

A C++ compiler has a very hard time diagnosing a missing ; because the language has such flexibility that a missing ; almost always looks like some error in some more complex construct, rather than a missing ; in a simple construct.

So for strange error messages, you need to be on the lookout for the missing ;
 
Old 01-16-2009, 02:46 PM   #3
Len Tyree
Member
 
Registered: May 2008
Location: An American in Thailand
Distribution: Ubuntu 9.10 (of course)
Posts: 37

Original Poster
Rep: Reputation: 15
solved

thanks to johnsfine, problem solved.

a simple case of "not looking"

ehanks, len tyree
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help for C++ programming using Geany sonypaulpeter Programming 2 12-13-2008 12:25 PM
geany not finding libraries vdogvictor Programming 3 10-07-2008 10:29 AM
Geany key-bindings problem blastradius Programming 0 08-05-2008 12:51 AM
Geany IDE with ARM tool chain??? raedbenz Linux - Embedded & Single-board computer 0 06-06-2008 09:01 AM
LXer: I dream of Geany LXer Syndicated Linux News 0 04-06-2007 03:01 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration