View previous topic :: View next topic |
Author |
Message |
deadbeat n00b
Joined: 29 May 2002 Posts: 26
|
Posted: Fri Aug 02, 2002 12:18 pm Post subject: c++ question: no matching function call |
|
|
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 |
|
|
trythil Tux's lil' helper
Joined: 06 Jun 2002 Posts: 123 Location: RHIT, Terre Haute, IN, USA
|
Posted: Fri Aug 02, 2002 4:14 pm Post subject: |
|
|
edit: You have no class abc.
[rest deleted for clarity] |
|
Back to top |
|
|
deadbeat n00b
Joined: 29 May 2002 Posts: 26
|
Posted: Sat Aug 03, 2002 4:15 am Post subject: |
|
|
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 |
|
|
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Fri Aug 09, 2002 8:37 am Post subject: |
|
|
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 |
|
|
trythil Tux's lil' helper
Joined: 06 Jun 2002 Posts: 123 Location: RHIT, Terre Haute, IN, USA
|
Posted: Sat Aug 10, 2002 4:10 am Post subject: |
|
|
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 |
|
|
deadbeat n00b
Joined: 29 May 2002 Posts: 26
|
Posted: Sat Aug 10, 2002 7:12 am Post subject: |
|
|
how embarring.. i fixed it, it was caused by a misstype :*{ |
|
Back to top |
|
|
|