http://gnuwin32.sourceforge.net/packages/gsl.htm
#i nclude <gsl/gsl_sf.h>
{
std::cout << gsl_sf_gamma_inc( 1.5, 0.5 ) << std::endl;
std::cout << gsl_sf_gamma_inc_Q( 1.5, 0.5 ) << std::endl;
std::cout << gsl_sf_gamma_inc_P( 1.5, 0.5 ) << std::endl;
}
http://www6.in.tum.de/~kiss/WinGsl.htm
Windows vesrsion of the GNU Scientific Library
Description
Here you will find a MS-VC++ adaptation of the GNU gsl-1.4 library. It's free in the sense of GNU licensing scheme.
You have the choice to download the complete set of source code and compile yourself or download just the precompiled static/dynamic libraries.
WinGsl-1.4.xx
Contain the complete set of free source code, help and samples based on gsl-1.4, necessary to compile and use the scientific library under Windows with MS-VC++ 6.0 / 7.0
WinGsl-1.4.01 / 09.07.2004 First release. ( ~3.6 MB)
WinGsl-1.4.02 / 11.08.2004 Current version.
WinGsl-Lib-1.4.xx
Contains a ready-to-use set of static and dynamic libraries generated from WinGsl-1.4.xx.
WinGsl-Lib-1.4.01 / 09.07.2004 First release. ( ~16.8 MB, VC++ 6.0)
WinGsl-Lib-1.4.02 / 11.08.2004 Current version ( VC++ 6.0).
WinGsl-Lib-1.4.03 / 27.08.2004 Current version ( .NET 2003).
---------------------------------------------------------------------------------------------------------------------
GNU數學函數庫gsl在windows下的移植
1.gsl在dev-c++下的移植:
(1)下載gsl-1.8.exe:
http://gnuwin32.sourceforge.net/packages/gsl.htm
(2)安裝gsl,安裝後在安裝目錄下將有如下目錄
/contrib/gsl-1.8 一些說明文件
/bin 二進制文件
libgsl.dll gsl的動態鏈接庫(基於gcc的正式版本)
libgsl_d.dll gsl的動態鏈接庫(基於gcc的調試版本)
libgslcblas.dll cblas的動態鏈接庫(基於gcc的正式版本)
libgslcblas_d.dll cblas的動態鏈接庫(基於gcc的調試版本)
gsl-histogram.exe 用於計算數據直方圖的程序
gsl-randist.exe 用於生成服從指定分佈數據的程序
/lib 庫文件
libgsl.a gsl的靜態鏈接庫(基於gcc的正式版本)
libgsl_d.a gsl的靜態鏈接庫(基於gcc的調試版本)
libgslcblas.a cblas的靜態鏈接庫(基於gcc的正式版本)
libgslcblas_d.a cblas的靜態鏈接庫(基於gcc的調試版本)
libgsl_dll.a libgsl.dll的gcc輸入庫
libgsl_d_dll.a libgsl_d.dll的gcc輸入庫
libgslcblas_dll.a libgslcblas.dll的gcc輸入庫
libgslcblas_d_dll.a libgslcblas_d.dll的gcc輸入庫
libgsl.def 輸出libgsl.dll的定義
libgslcblas.def 輸出libgslcblas.dll的定義
/doc 有關文檔
/info
/man1
/man3
各種格式的gsl幫助文件
/include/gsl 頭文件
gsl include files
其中使用到的主要有bin,lib,include/gsl下的文件
(3)設置dev-c++編譯環境,有兩種方式:
一、這種最簡單,將gsl安裝目錄下的bin下libgsl.dll,libgslcblas.dll複製到dev-c++安裝目錄下的bin目錄下;lib下libgsl.a,libgslcblas.a複製到dev-c++安裝目錄下的lib目錄下;include下的整個gsl文件夾複製到dev-c++安裝目錄下的include目錄下。打開dev-c++,工具-編譯選項-編譯器,選上“在連接器命令行加入如下命令”,加入-lgsl -lgslcblas(即在連接時連上libgsl.a,libgslcblas.a,gcc可以自動識別前綴lib和後綴.a)
#i nclude <stdio.h>
#i nclude <gsl/gsl_sf_bessel.h>
int main(void)
{
double x = 5.0;
double y = gsl_sf_bessel_J0(x);
printf("J0(%g) = %.18en", x, y);
system("pause");
return 0;
}移植
可以正常運行。
二、打開dev-c++,工具-編譯選項-目錄,分別將gsl安裝目錄下的lib,include加入到庫和頭文件的路徑中。最後,在編譯器選項中,選中“在連接器命令行加入如下命令”,加入-lgsl -lgslcblas,即可以正常使用gsl。
(1)下載WinGsl-Lib-1.4.02.zip
http://www6.in.tum.de/~kiss/WinGsl.htm
(2)解壓到臨時目錄,WinGsl中的庫文件的擴展名是.lib,可用於Visual C++ 6.0 的編譯器
(3)設置Visual C++ 6.0編譯環境,有兩種方式:
一、將臨時目錄下bin中的WinGsl.dll和WinGslD.dll複製到~/Microsoft Visual Studio/VC98/Bin下;整個Gsl目錄複製到~/Microsoft Visual Studio/VC98/Include下;lib目錄下的所有.lib文件全部複製到~/Microsoft Visual Studio/VC98/Lib下。在使用gsl函數時,在新建的工程中,project-settings-link,在object/library modules中加入你用到的庫文件,如WinGsl.lib等,加入多個可以用空格隔開。
二、打開VC,tools-options-directories,將解壓目錄下的lib,gsl分別加入到庫文件和頭文件的搜索路徑中,將WinGsl.dll和WinGslD.dll複製到
---------------------------------------------------------------------------------------------------------------------
GSL 在 Windows開發環境下的使用
2005-9-11
GSL(GNU Scientific Library)是一個非常不錯的科學計算函數庫,本站前面已經有文章對此做過介紹,本文將主要介紹在Win32平臺三個不同的開發環境下如何使用這個軟件庫
首先將D:/temp下bin目錄中的兩個dll動態鏈結庫(libgsl.dll和libgslcblas.dll)複製到 mingw 的 bin 目錄中(gcc路徑必須在 PATH 中)或者乾脆直接複製到 C:/Windows 或者 C:/Windows/system32 中,總之是程序運行的話必須可以找到這兩個動態鏈結庫。
編譯命令是:
gcc test.c -o text.exe -lgsl
二、Visual C++ 7.0
implib -af libgslcblas.lib libgslcblas.dll然後將這兩個lib文件複製到 BCB 的 lib 目錄下即可。D:/teml/lib 下的 libgsl-bcc.lib 和 libgslcblas-bcc.lib 經過我試驗在BCB編譯中不可用。只能用implib產生的lib檔。
#i nclude <stdio .h>
#i nclude <gsl /gsl_sf_bessel.h>
{
double x = 5.0;
double y = gsl_sf_bessel_J0(x);
printf ("J0(%g) = %.18en", x, y);
return 0;
}