Problems with my first class.
main.cpp
Code:
#include <iostream>
#include "Memoryx.cpp"
int main(){
Memoryx::que();
return 1;
}
Memoryx.cpp
Code:
#include "Memoryx.h"
Memoryx::que(){
printf("aaa");
}
Memoryx.h
Code:
#ifndef __MEMORYX_H__
#define __MEMORYX_H__
class Memoryx{
public:
que();
};
#endif
Error:
Code:
Compiler: Default compiler
Building Makefile: "C:\Documents and Settings\robdah01\Skrivbord\classtest\Makefile.win"
Executing make...
make.exe -f "C:\Documents and Settings\robdah01\Skrivbord\classtest\Makefile.win" all
g++.exe -c main.cpp -o main.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"
In file included from main.cpp:3:
Memoryx.h:6: error: ISO C++ forbids declaration of `que' with no type
main.cpp: In function `int main()':
main.cpp:8: error: cannot call member function `int Memoryx::que()' without object
make.exe: *** [main.o] Error 1
Execution terminated
This is my first class, i get an error while compiling.
How much i try to figure out why this isn't working.
I want to learn how to write file inclusions, and classes.