SimplyFortran调用appGraphics问题
最近安装了simply Fortran,看见帮助文档里面有appGraphics,就想学学做界面,但是按照help文档里的例子做,却提示出错程序:
program main
use appgraphics
implicit none
integer::myscreen
integer :: root_menu,file_menu,item
interface
subroutine quit()
end subroutine quit
end interface
interface
subroutine save()
end subroutine save
end interface
myscreen = initwindow(800, 600, closeflag=.TRUE.)
call loop()
root_menu = addmenu("", MENU_FOR_WINDOW)
file_menu = addmenu("File", root_menu)
item = addmenuitem("Save", file_menu, save)
item = addmenuitem("Quit", file_menu, quit)
call closewindow(myscreen)
end program main
错误提示:
Generating Makefile... Okay
==============================================================================
Processing default resource
Generating graphics.exe
build\main.o: In function `MAIN__':
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
C:\Users\fpchi\Fortran\Empty/./main.f90:24: undefined reference to `save_'
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
C:\Users\fpchi\Fortran\Empty/./main.f90:25: undefined reference to `quit_'
collect2.exe: error: ld returned 1 exit status
Error: Last command making (graphics.exe) returned a bad status
Error: Make execution terminated
* Failed *
请教是什么原因,是需要一些额外的设置么?
明白了,那个“save”和“quit”是自己写的过程名。。。还以为是编译器已经给写好的。。。 这俩函数需要你自己写。写俩空白的就好了。
program main
use appgraphics
implicit none
integer::myscreen
integer :: root_menu,file_menu,item
interface
subroutine quit()
end subroutine quit
end interface
interface
subroutine save()
end subroutine save
end interface
myscreen = initwindow(800, 600, closeflag=.TRUE.)
root_menu = addmenu("", MENU_FOR_WINDOW)
file_menu = addmenu("File", root_menu)
item = addmenuitem("Save", file_menu, save)
item = addmenuitem("Quit", file_menu, quit)
call loop()
call closewindow(myscreen)
end program main
Subroutine quit()
stop
End Subroutine quit
Subroutine save()
End Subroutine save 谢谢回答,明白了:-hug:
页:
[1]