I am trying to use libfann version 2.0.1 instead of the newest version 2.2.0, but could not figure out how to do so. Any thoughts on how to do that?
normally that works perfectly:
gcc fann_calculator.c -o run_fann_calculator -lfann -lm
where fann_calculator.c contains a program that calls a neural network.
Thanks
It depends upon where the two libraries sit. If they are installed in the same directory (e.g. both installed in
/usr/lib/) you’ll probably get the youngest one.I suggest to carefully read the ld.so(8) and ldd(1) man pages. You certainly can trace what library is loaded (with e.g. the
LD_DEBUGenvirnonment variable). Don’t forget to re-run ldconfig appropriately after library installation.You could also play some
LD_LIBRARY_PATHtrick; for instance, set it to$HOME/lib:/usr/liband install appropriate symlinks in your$HOME/lib/to the precise library you want. For instance, you might dothen check with
ldd run_fann_calculatorthat you get the expected [version of the]libfannlibrary.Don’t forget to read the Program Library Howto. You might want to pass appropriate flags to ld such as
-rpath. You may need to pass them usinggcc, perhaps with Gcc Link Options such as-Wl