I did included the c4d_resource.h and the error disappeared.
I was migrating by simply fixing the errors that appeared inside Xcode, until everything was clear.
But now, I started by duplicating a similar plugin from the sdk and pasting just the parts of the code that belong to my plugin.
The "solution" I came up with was this:
and then go through all the objects of doc2, recursively.
Is this a correct way of doing things?