Lol, 7stud, you'll appreciate this more than anyone else here, but that's what I'm doing with my Orc at the moment.
Attempting to make a class (monster) So that I could just use it to define Orc....
Type: Posts; User: Smeep
Lol, 7stud, you'll appreciate this more than anyone else here, but that's what I'm doing with my Orc at the moment.
Attempting to make a class (monster) So that I could just use it to define Orc....
Lol, I've already run in to my next set of problems, but this time I have some limited Idea about them, so it shouldn't be a problem.
I did. That worked.
Then I added monster.cpp and monster.h.
There was an error. (i typed #end instead of #endif)
So I fixed that.
AND IT F@£"!G WORKS!
That works. (no result as such, just runs and closes straight away)
What I'm going to do, is get all my code, then remake the project. Just like I did with yours. Maybe Something went odd along...
Roger wilco. Will report back with results.
Nope :(
Still not recognising GetStat()
I'm guessing a problem with Dev-C++
I've changed that to
Orc();
That correct?
Man I love coding. ;) I made the biggest thread on the page.
Stupidly, I knew that. An honest mistake.
Right now, In statcheck.cpp, I've changed the function getstat() definition to
// statcheck.Cpp
#include <cstdio>
#include <cstdlib>
#include...
Lol, I've been reading reading and re-reading this entire thread.
I'm pretty sure I'm getting there. Let me try "explaining" it.
In a .h file, you are basically letting the other files know,...
Yeah, All the above works. monster.h already works. It's GetStat in statcheck.h and statcheck.cpp that doesn't work.
Monster.cpp is calling in GetStat() from statcheck.cpp/h
That's where it...
It is exactly the same.
I don't understand what that has to do with why my compiler won't recognise the function that I have?
In monster.h, it IS #endif, I just copied it wrong.
Should it be (int intelligence) if intelligence is already declared? (edit - It should be "mana" there, intelligence is already defined as 2,...
Right. Scrap the previous post. I'm still having linker problems, even though I have put them all in the same project.
Here's the differen't files I have.
Main.cpp
#include <iostream>...
eGads. I am now so very happy. I could wet the bed! WOOHOOOOO!
Thank you all so much!
Seems that my happines was meant to be shot down.
//StatCheck.H
#ifndef STATCHECK_H
I did, thank you so much. You really made my day.
As per tip given, I have made a thread about how to add a file to a project in bloodshed. I'm using version 4.9.8.0
Here's the original suggestion from the thread:
thanks for the advice.
Good god yes. I think I found an FAQ on it, but the problem was that it baffled me. I need a simple tutorial. As you will see if you visit my other thread, I don't currently know what is wrong, but...
This is exactly what I am trying to avoid. The point in this particular project is teaching me to use multiple files. And From what I can see, I know roughly how it works.
I am useing
...
I don't know, you tell me. I am, to be quite honest, diving in head first to a dark hole. I don't know why not use classes. Would a class work for many differen't other files?
I have done this. When I compile, it tells me
[Linker error] undefined reference to `someFunc()'
I'm still checking everything over right now.
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include "StatCheck.H"
#include <cstring>
using namespace std;
int main(int nNarg, char* pszArgs[])
{ ERROR IS HERE
Cheers.
Right, I'm getting the following error right now,
"9 C:\Dev-Cpp\CPP_Programs\Chap01\rpg\orc.cpp
declaration of C function `int "
When I try to compile it.
Hmmm, not sure we are on the same page.
I want to have a file, call it monster X, which uses a file, Statcheck to determin the amount of mana it has.
I also want to be able to use Statcheck,...