[問題] gsl 使用問題...

看板C_and_CPP (C/C++)作者 ( )時間14年前 (2011/07/23 19:34), 編輯推噓0(002)
留言2則, 2人參與, 最新討論串1/1
開發平台(Platform): (Ex: VC++, GCC, Linux, ...) gcc (Ubuntu 4.4.1-4ubuntu9) 4.4.1 額外使用到的函數庫(Library Used): (Ex: OpenGL, ...) gnu scintific library 問題(Question): 編譯不會過... /tmp/cc1nkObb.o: In function `main': test_gsl_bessel.cpp:(.text+0x8e): undefined reference to `gsl_sf_bessel_I1' collect2: ld returned 1 exit status 麻煩有經驗的高手指導一下 謝謝 程式碼(Code):(請善用置底文網頁, 記得排版) #include<iostream> #include<vector> #include<gsl/gsl_sf_bessel.h> using namespace std; int main(){ vector<double> x; for(int i=1;i<=16;i++) { x.push_back(i/2.0); } for(vector<double>::const_iterator i=x.begin();i!=x.end();i++) cout<<scientific<<gsl_sf_bessel_I1(*i)<<"\n"; return 0; } -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 122.118.65.211

07/23 19:36, , 1F
-lgsl -lgslcblas -lm ? http://0rz.tw/yGa5D
07/23 19:36, 1F

07/23 19:50, , 2F
OK thanks
07/23 19:50, 2F
※ 編輯: shomingchang 來自: 122.118.65.211 (07/23 21:47)
文章代碼(AID): #1EAh6px8 (C_and_CPP)
文章代碼(AID): #1EAh6px8 (C_and_CPP)