Hi All
I have the most simple situation, but I cannot compile it
I have the following files: main.C, Book.C and Book.h:
Book.h:
Code:
class Boek {
public:
Boek() ;
~Boek() {}
void print() ;
} ;
Book.C:
Code:
#include "Book.h"
Book::Book() {}
void Book::print() {}
main.C:
Code:
#include "Book.h"
#include <string>
#include <iostream>
using namespace std ;
int main() {
Book book() ;
book.print() ;
return 0 ;
}
If I compile this code like: c++ main.C Book.C
I get the following error:
Code:
main.C:9 error: request for member ‘print’ in ‘book’, which is of non-class type ‘Book ()()’
If I remove the line book.print() eveything compiles fine
Any suggestions what I do wrong here ?
Thanks a lot
LuCa