Hallo iedereen,
Ik heb in mijn applicatie een hele hoop foutmeldingen verholpen. Nu heb ik een paar fouttmeldingen waar ik even niks meer van begrijp. volgens mij zijn het #include foutmeldingen.
Dit is mijn Include structuur:
Ball.cpp & Ball.h
Ball.cpp:
#include <SDL/SDL.h>
#include "Ball.h"
#include <iostream>
Ball.h:
#include <SDL/SDL.h>
Bat.cpp & Bat.h
Bat.cpp
#include <SDL/SDL.h>
#include "Bat.h"
Bat.h:
#include <SDL/SDL.h>
Graphics.cpp & Graphics.h
Graphics.cpp:
#include "Graphics.h"
#include <SDL/SDL.h>
#include <iostream>
Graphics.h:
#include <SDL/SDL.h>
#include "Ball.h"
#include "Player.h"
main.cpp
#include "Pong.h"
#include <iostream>
Player.cpp & Player.h
Player.cpp:
#include <SDL/SDL.h>
#include <iostream>
#include "Player.h"
Player.h:
#include <SDL/SDL.h>
#include <iostream>
#include "Bat.h"
Pong.cpp & Pong.h
Pong.cpp:
#include <SDL/SDL.h>
#include <iostream>
#include "Bat.h"
Pong.h:
#include <SDL/SDL.h>
#include "Graphics.h"
#include "Player.h"
Er is sprake van een overerving: de class player krijgt alle eigenschappen en waardes van de class Bat.
Dit is de compile Error die ik krijg:
In file included from Player.h:3,
from Pong.h:3,
from main.cpp:1:
Bat.h:3: error: redefinition of ‘class Bat’
Bat.h:4: error: previous definition of ‘class Bat’
In file included from Pong.h:3,
from main.cpp:1:
Player.h:5: error: redefinition of ‘class Player’
Player.h:6: error: previous definition of ‘class Player’
In file included from Player.h:3,
from Pong.h:3,
from Pong.cpp:2:
Bat.h:3: error: redefinition of ‘class Bat’
Bat.h:4: error: previous definition of ‘class Bat’
In file included from Pong.h:3,
from Pong.cpp:2:
Player.h:5: error: redefinition of ‘class Player’
Player.h:6: error: previous definition of ‘class Player’
Alvast bedankt voor de hulp!
Grt,
JV.com