[gmx-users] help needed for using xdr library
Kun Huang
harryhuangkun at gmail.com
Mon Aug 17 15:41:41 CEST 2009
Hello everyone:
Recently I am trying to use the xdr library downloaded from gromacs org to
read xtc files. However when I link my program with the library there is an
error. When I ran the make test, all the tests were passed. Thus I think
that the library should work just I don't know how to link the program. I
tried to read the makefile in the library but it is very
complicated and beyond my scope. My program is very simple:
//source file of cm.cc
#include"/home/kun/xdr/include/xdrfile/xdrfile_xtc.h"
int main()
{
char * fn="fdifal";
int n=1;
read_xtc_natoms(fn, &n);
return 0;
}
and I could compile it. When I use
g++ cm.o /home/kun/xdr/lib/libxdrfile.a there is a link error:
cm.o: In function `main':
cm.cc:(.text+0x2d): undefined reference to `read_xtc_natoms(char*, int*)'
collect2: ld returned 1 exit status
Could anyone help me?
Thank you very much.
Have a nice weekends
Kun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-users/attachments/20090817/1a5d1495/attachment.html>
More information about the gromacs.org_gmx-users
mailing list