编辑:问题已解决,请参阅下面的答案。
Oneiric 中的 GSL 库有问题吗?我在链接时遇到问题,不明白为什么 - 这在 10.4、10.10 和 11.4 中工作正常。
编辑:首先是小测试用例,完整的问题如下:
在 Natty 上工作正常:
$ cat /etc/issue
Ubuntu 11.04 \n \l
$ cat gsl-test.cpp
#include <gsl/gsl_errno.h>
void handler(const char *, const char *, int, int) { }
int main() { gsl_set_error_handler(handler); }
$ g++ gsl-test.cpp ## Expect problems since libraries not linked in
/tmp/ccnjUNdv.o: In function `main':
gsl-test.cpp:(.text+0x16): undefined reference to `gsl_set_error_handler'
collect2: ld returned 1 exit status
$ g++ -lgsl -lgslcblas gsl-test.cpp
$ ./a.out
$
Run Code Online (Sandbox Code Playgroud)
在 …
11.10 ×1