在Ubuntu上使用Fortran GUI庫可參考以下步驟:
sudo apt update
和sudo apt install gfortran
命令安裝GNU Fortran編譯器。sudo apt install libgtk-3-dev
或sudo apt install libgtk-4-dev
。若使用其他庫,如Qt,可安裝libqt5core5a
等開發包。sudo apt install geany
等命令安裝。use gtk
,并調用相關函數創建窗口等。gfortran
編譯,鏈接庫時用pkg-config
獲取編譯選項,如gfortran -o hello_world hello_world.f90
pkg-config --cflags --libs gtk±3.0``。./hello_world
運行程序。此外,還可選擇gtk-fortran等專門的Fortran GUI庫,其安裝和使用可參考其官方文檔。