Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
c++ question: no matching function call
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
deadbeat
n00b
n00b


Joined: 29 May 2002
Posts: 26

PostPosted: Fri Aug 02, 2002 12:18 pm    Post subject: c++ question: no matching function call Reply with quote

hi all, i have something like this

abc.h:
class abc {
public:
// constructor destructor yada yada
// note: i did overload the constructor if it helps.
somefunction (char *something);
}

abc.cc
#include "abc.h"
// constructor destructor yada yada
abc::somefunction (char *something)
{
//stuff
}

main.cc
#include "abc.h"
//... then in a function or somethin
abc *mystuff = new abc;
mystuff->somefunction("sometext");
delete mystuff;

and i get:

main.cc:73: no matching function for call to `abc::somefunction (char *&)'

note the function names and what not have been changed to protect the innoce...err just typed this up from my head just to show the relevant parts...

thx
-j


Last edited by deadbeat on Sat Aug 03, 2002 4:14 am; edited 1 time in total
Back to top
View user's profile Send private message
trythil
Tux's lil' helper
Tux's lil' helper


Joined: 06 Jun 2002
Posts: 123
Location: RHIT, Terre Haute, IN, USA

PostPosted: Fri Aug 02, 2002 4:14 pm    Post subject: Reply with quote

edit: You have no class abc. :P

[rest deleted for clarity]
Back to top
View user's profile Send private message
deadbeat
n00b
n00b


Joined: 29 May 2002
Posts: 26

PostPosted: Sat Aug 03, 2002 4:15 am    Post subject: Reply with quote

oof, that was a mistake when i just changed the class names to simplify my message. its correct in the actual code. same error :{
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Fri Aug 09, 2002 8:37 am    Post subject: Reply with quote

Perhaps something got lost in the translation/simplification. When I condense your example into one file, like this:
Code:
class abc {
public:
   void somefunction (char *something);
};

void abc::somefunction (char *something)
{
}

int main( int argc, char ** argv ) {
   abc *mystuff = new abc;
   mystuff->somefunction("sometext");
   delete mystuff;
}

...it compiles without a problem for me. Could you please post a (preferably single-file) compilable example that demonstrates your error message?
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
trythil
Tux's lil' helper
Tux's lil' helper


Joined: 06 Jun 2002
Posts: 123
Location: RHIT, Terre Haute, IN, USA

PostPosted: Sat Aug 10, 2002 4:10 am    Post subject: Reply with quote

I sent deadbeat a compilable example that used a similar file topology via PM a day or two ago; hopefully he'll respond back here if anything pops up :)
Back to top
View user's profile Send private message
deadbeat
n00b
n00b


Joined: 29 May 2002
Posts: 26

PostPosted: Sat Aug 10, 2002 7:12 am    Post subject: Reply with quote

how embarring.. i fixed it, it was caused by a misstype :*{
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum