[gmx-users] Using the XTC library

Ryan S Davis (rsdavis1) rsdavis1 at memphis.edu
Sat May 7 05:31:23 CEST 2011


I am trying to use the XTC library in my code but I am just not good at this stuff.
http://www.gromacs.org/Developer_Zone/Programming_Guide/XTC_Library


I installed using
./configure --prefix=/$HOME/apps/xdrfile
make install

everything seemed to go well and the make check said everything passed.

So then I try a test code

  1 #include <iostream>
  2 #include "xdrfile_xtc.h"
  3 using namespace std;
  4 
  5 int main()
  6 {
  7 
  8      int natoms;
  9      read_xtc_natoms("traj.xtc", &natoms);
 10     return 0;
 11 }

and I compile with

icc  -I/$HOME/apps/xdrfile/include/xdrfile  -L/$HOME/apps/xdrfile/lib/  test.cpp

and i get an error saying...

undefined reference to 'read_xtc_natoms(char *, int*)'

I am sure that I am doing something stupid. I tried a C compiler and linking to few other random places but, like I said, this stuff (installing libraries and linking) is new to me.
Please help.

Thanks
Ryan


More information about the gromacs.org_gmx-users mailing list