Working code:
Changed the libraries and calls, finally used GSL and Eigen libraies!
Fixed few things and finally a working snippet of the program.