Hello everyone:<br><br>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 <br>
complicated and beyond my scope. My program is very simple:<br>//source file of cm.cc<br>#include"/home/kun/xdr/include/xdrfile/xdrfile_xtc.h"<br>int main()<br>{<br> char * fn="fdifal";<br>
int n=1;<br>
read_xtc_natoms(fn, &n);<br><br> return 0;<br>}<br>and I could compile it. When I use <br>g++ cm.o /home/kun/xdr/lib/libxdrfile.a there is a link error:<br>cm.o: In function `main':<br>cm.cc:(.text+0x2d): undefined reference to `read_xtc_natoms(char*, int*)'<br>
collect2: ld returned 1 exit status<br>Could anyone help me? <br><br>Thank you very much.<br>Have a nice weekends<br><br>Kun