Update: I found the solution. You need to declare resultP = Ref{Cdouble}()
resultP = Ref{Cdouble}()
thank you in any case