Anyone having this problem? it seems like my removeGWindow is having a problem but dont know where it was from. :/
2 Answers
The removeGWindow()
function is already defined in the SPL library, you don't have to declare it yourself. You can use it according to its definition void removeGWindow(GWindow gw, GObject gobj)
.
-
Also if you pay close attention the the compiler's error you will read
multiple definition of 'removeGWindow'
. That should have given you a nudge toward the solution.– ChrisGCommented Jul 18, 2015 at 17:12
I had similar confusion but notice that the bricks init function returns void so accessing and removing bricks using detect collision means you need to excludes the instances where the object the ball collides with, is not a brick and fortunately the init functions for the other objects returns an object and so has a variable associated with it. So u can do this using code below after calling detect collision.
(object! =label&&object!= window&& object!= paddle) removeGObject(object);
And don't forget to check for null.