Well I did it like I learned it in a Tutorial, but it didn't work.
I made my class outside my main.ccp. So I have the headerfile of my class 'Example' (example.h) and the other one (example.cpp). Inside the example.cpp, I now create following void function: