2015/02/03

On the usage of GSL(gnu scientific libraries) with Ubuntu.

try

$ gcc -Wall -I/usr/include test.c -L/usr/lib -lgsl -lgslcblas -lm -o test

do not scramble these options and keep the form.

You can also verify the include-path along the personal environment by checking as follows.

$ gcc-config --cflags --libs
-I/usr/include
-L/usr/lib -lgsl -lgslcblas -lm

enjoy!


ubuntuでgslがうまくインクルードできない(undefined reference to `gsl_....')となる場合、
面倒だがインクルードパスを手動で設定する他ない。(gccのデフォルト参照パスを変えれば変わるかもしれんが)


0 件のコメント: