ColumbiaCollegeGameDev/CCGameEngine — Issue #3: Linker Problem - Shrink
Author: afdave14
Created: 2012-03-07 23:24:17+00:00
State: open

I've created a shrink method within the Image class. The parameters are a Surface and two doubles and it shrinks the image by the given ratio and blits it on the screen using the Surface argument. Apparently the compiler doesn't like it when two header files link each other. I'm getting the following error:

In file included from Surface.h:6:0,
from main.cpp:3:
Images.h:28:15: error: ‘Surface’ has not been declared
Images.h: In member function ‘void Image::shrink(int, double, double)’:
Images.h:33:8: error: request for member ‘put_image’ in ‘surf’, which is of non-class type ‘int’
In file included from Surface.h:6:0,
from Surface.cpp:3:
Images.h:28:15: error: ‘Surface’ has not been declared
Images.h: In member function ‘void Image::shrink(int, double, double)’:
Images.h:33:8: error: request for member ‘put_image’ in ‘surf’, which is of non-class type ‘int’
make: *** [exe] Error 1

Suggestions?