Hello
because i've a load texture function in md2.cpp i THINK to
need to call the CMD2Model::Load in the md2.cpp
So i fire up enemies in this class:
in ogro.h:
class COgroEnemy : public CEnemy // CEnemy is derived from CEntity and
CEntity from Class CMD2Model
{
public:
COgroEnemy() { Load(); }
then in ogro.cpp:
void COgroEnemy::Load()
{
// load model
CMD2Model::Load("Models/Ogro/Tris.MD2", "Models/Ogro/Ogrobase.bmp");
}
error: no matching function for call to `COgroEnemy::Load()'
error: candidates are: int CMD2Model::Load(char*, char*)
that's in md2.h:
int Load(char *modelFile, char *skinFile);
What is my mistake here? The same works under Windows but i can't figure
out any differences with my Linux version above.
THANKS and regards
Michael 5 1399
> in ogro.h: class COgroEnemy : public CEnemy // CEnemy is derived from CEntity and CEntity from Class CMD2Model { public: COgroEnemy() { Load(); }
then in ogro.cpp: void COgroEnemy::Load() { // load model CMD2Model::Load("Models/Ogro/Tris.MD2", "Models/Ogro/Ogrobase.bmp"); }
error: no matching function for call to `COgroEnemy::Load()' error: candidates are: int CMD2Model::Load(char*, char*)
I don't see any declaration of COgroEnemy::Load() in the class
declaration.
Michael Sgier wrote: because i've a load texture function in md2.cpp i THINK to need to call the CMD2Model::Load in the md2.cpp So i fire up enemies in this class:
in ogro.h: class COgroEnemy : public CEnemy // CEnemy is derived from CEntity and CEntity from Class CMD2Model { public: COgroEnemy() { Load(); }
then in ogro.cpp: void COgroEnemy::Load() { // load model CMD2Model::Load("Models/Ogro/Tris.MD2", "Models/Ogro/Ogrobase.bmp"); }
Make sure that the declaration of 'COgroEnemy::Load()' is in the class
'COgroEnemy' _before_ the first use, IOW, before the constructor.
error: no matching function for call to `COgroEnemy::Load()' error: candidates are: int CMD2Model::Load(char*, char*)
that's in md2.h: int Load(char *modelFile, char *skinFile);
Change to
int Load(char const* modelFile, char const* skinFile);
(and in the implementation too).
What is my mistake here? The same works under Windows but i can't figure out any differences with my Linux version above.
V
Michael Sgier wrote: Hello because i've a load texture function in md2.cpp i THINK to need to call the CMD2Model::Load in the md2.cpp So i fire up enemies in this class:
in ogro.h: class COgroEnemy : public CEnemy // CEnemy is derived from CEntity and CEntity from Class CMD2Model { public: COgroEnemy() { Load(); }
You call Load() here with no parameters. Apparently CMD2Model::Load()
takes two parameters of type char* (though it should probably be const
char* or const std::string&) and there is no COgroEnemy::Load()
function with no parameters declared in the class COgroEnemy. If that's
not it, post a more complete piece of code that demonstrates the
problem. then in ogro.cpp: void COgroEnemy::Load() { // load model CMD2Model::Load("Models/Ogro/Tris.MD2", "Models/Ogro/Ogrobase.bmp"); }
error: no matching function for call to `COgroEnemy::Load()' error: candidates are: int CMD2Model::Load(char*, char*)
that's in md2.h: int Load(char *modelFile, char *skinFile);
What is my mistake here? The same works under Windows but i can't figure out any differences with my Linux version above.
I doubt the identical code works on Windows. Methinks something is
different between the two.
THANKS and regards Michael
Cheers! --M
Michael Sgier schrieb: Hello because i've a load texture function in md2.cpp i THINK to need to call the CMD2Model::Load in the md2.cpp So i fire up enemies in this class:
in ogro.h: class COgroEnemy : public CEnemy // CEnemy is derived from CEntity and CEntity from Class CMD2Model { public: COgroEnemy() { Load(); }
I looked into my crystal ball and read tea leaves, found that you have
this here in ogro.h:
int Load(char*, char*);
Changes this to void Load();
Well, I THINK you should read a good book about C++ before trying to
understand such a complex programm.
Thomas
Thomas J. Gritzan wrote: Michael Sgier schrieb:
Hello because i've a load texture function in md2.cpp i THINK to need to call the CMD2Model::Load in the md2.cpp So i fire up enemies in this class:
in ogro.h: class COgroEnemy : public CEnemy // CEnemy is derived from CEntity and CEntity from Class CMD2Model { public: COgroEnemy() { Load(); }
I looked into my crystal ball and read tea leaves, found that you have this here in ogro.h:
int Load(char*, char*);
Changes this to void Load();
Well, I THINK you should read a good book about C++ before trying to understand such a complex programm.
Thomas
Asumming this is the error then I think the OP should also read the
answers already pointed out to him. I pointed out earlier the
inconsistency in the number of arguments to Load.
To The OP, when you use a function you have to *declare*, *define* and
*call* the function with the same number of arguments (default argument
values aside).
john This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: vijay |
last post by:
Hello
I wanted to understand a contradictory design of C++
class A
{public:
virtual void f(){ cout<<" base f"<<endl; }
};
class B:public A
{
|
by: Warwick |
last post by:
Hi
I could use some help with inheritance and destructors.
I have been following an example in a book and the example has lead to
a situation which I have
reduced to a contrived example that...
|
by: ProgrammierMan |
last post by:
Hi folks,
I don't know what the block attribute means. The final attribute looks
like to be simple: I can prevent derivations. Did I write
final="restriction" and I restrict it in another...
|
by: tthunder |
last post by:
Hi @all,
Perhaps some of you know my problem, but I had to start a new thread.
The old one started to become very very confusing.
Here clean code (which compiles well with my BCB 6.0 compiler)....
|
by: Steven T. Hatton |
last post by:
Now that I have a better grasp of the scope and capabilities of the C++
Standard Library, I understand that products such as Qt actually provide
much of the same functionality through their own...
|
by: ACMSM2002 |
last post by:
Hello,
can xsd.exe generates runtime classes from an XSD schema
containig a super-class and a derived-class?
<MSDN>Xsd.exe only allows you to manipulate XML schemas
that follow the XML Schema...
|
by: Tak-Shing Chan |
last post by:
Dear c.l.c regulars,
How about codifying a list of acceptable acronyms on c.l.c?
<g>
<g,d&r>
<VBG>
AAMOF
AFAIAA
AFAIAC
|
by: steve.kaye |
last post by:
I am writing a number of controls which use inheritance and I have a
problem that I do not know how to solve. It's best if I describe the
class structure I want.
Grid - derives from UserControl...
|
by: =?Utf-8?B?U3dhcHB5?= |
last post by:
Can anyone suggest me to pass more parameters other than two parameter for
events like the following?
Event:
Onbutton_click(object sender, EventArgs e)"
Event handler:
button.Click += new...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |