[gmx-users] Trying to link C++ code with libgmx. Please help!

Semen Esilevsky yesint4 at yahoo.com
Mon Mar 23 12:13:51 CET 2009






----- Original Message ----
From: David van der Spoel <spoel at xray.bmc.uu.se>
To: Discussion list for GROMACS users <gmx-users at gromacs.org>
Sent: Monday, March 23, 2009 12:40:19 PM
Subject: Re: [gmx-users] Trying to link C++ code with libgmx. Please help!

Semen Esilevsky wrote:
> Dear gmx users,
> I'm trying to read and write xtc files from my own code written in standard C++. I included xtcio.h and linking with libgmx.a. However when I'm trying to compile I get hundreds of errors like:
> 
> /usr/local/gromacs/include/gromacs/types/simple.h|124|error: reference to ‘real’ is ambiguous|
> /usr/local/gromacs/include/gromacs/types/simple.h|109|error: candidates are: typedef float real|
> /usr/include/c++/4.3/complex|538|error:                 template<class _Tp> const _Tp& std::real(const std::complex<_Tp>&)|
> ....
> 
> As far as I can figure out the problem is in simple.h where multiple redefinitions of real occur:
> 
> typedef real            rvec[DIM];
> typedef double           dvec[DIM];
> typedef real            matrix[DIM][DIM];
> typedef real            tensor[DIM][DIM];
> typedef int             ivec[DIM];
> typedef int             imatrix[DIM][DIM];
> 
> I have absolutely no idea how to overcome this error. Any help is appreciated!
> 
We are about to release a special external library for this purpose. As a matter of fact you can download the development version of it using cvs. (cvs co libxdrfile). trr support is not functional yet, but xtc works.

Thank you for suggestion! It would be great if the library would be free from such nasty problems. 
Could you please post a full cvs command to get the dev version?

Sincerely,
Semen



      



More information about the gromacs.org_gmx-users mailing list