The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Multiple crontab entries crashing server alexandicity Linux 2 05-12-2008 06:25 AM
Sun Fire v1280 is crashing esofthub UNIX for Advanced & Expert Users 2 06-02-2007 01:57 PM
memory functions crashing in AIX abhinav05252 High Level Programming 0 12-07-2006 03:46 AM
dlclose crashing in 64bit ajphaj High Level Programming 3 12-05-2006 03:44 AM
It's first class! Leksej UNIX Desktop for Dummies Questions & Answers 0 06-16-2006 09:30 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 02-09-2007
Registered User
 

Join Date: Feb 2007
Location: Belgium
Posts: 6
Question c++ class keeps crashing

i just started learning to prog in c++, im using netbeans.
i tryed to make a class and i keep getting this error. what am i doing wrong ?
-----------------------------
class test
{
public:
int funtime();

private:
int time;
};

int test::funtime()
{
return time;
}


---------------------------
when i try to build
i keep getting the error
/home/leandro/netbeans/testjes/testklasse.cc:13: multiple definition of `test::funtime()'

thnx in advance
Reply With Quote
Forum Sponsor
  #2  
Old 02-09-2007
Moderator
 

Join Date: Sep 2002
Location: Hong Kong, China
Posts: 1,469
Did you try compiling it on the command line, e.g.

g++ test.cpp -c -o test.o

? Your pasted snippet works for me.
Reply With Quote
  #3  
Old 02-09-2007
Registered User
 

Join Date: Feb 2007
Location: Belgium
Posts: 6
mmm ill explain better
-------------------------
overvieuw

main

class rubbish that gives the error

my output
Reply With Quote
  #4  
Old 02-09-2007
milhan's Avatar
Registered User
 

Join Date: Oct 2002
Location: /home
Posts: 121
change the filename to rubbish.h where you define the class rubbish, and include it as # include "rubbish.h" in the main file. Otherwise i don't see anything else wrong.
Reply With Quote
  #5  
Old 02-11-2007
Registered User
 

Join Date: Feb 2007
Location: Belgium
Posts: 6
Quote:
Originally Posted by milhan
change the filename to rubbish.h where you define the class rubbish, and include it as # include "rubbish.h" in the main file. Otherwise i don't see anything else wrong.

that worked thnx
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 07:30 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0