Fortran Coder

查看: 5777|回复: 3
打印 上一主题 下一主题

[绘图界面库] SimplyFortran调用appGraphics问题

[复制链接]

7

帖子

3

主题

0

精华

入门

F 币
36 元
贡献
20 点
跳转到指定楼层
楼主
发表于 2018-10-18 15:21:34 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
最近安装了simply Fortran,看见帮助文档里面有appGraphics,就想学学做界面,但是按照help文档里的例子做,却提示出错
程序:
[Fortran] 纯文本查看 复制代码
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 *

请教是什么原因,是需要一些额外的设置么?

分享到:  微信微信
收藏收藏 点赞点赞 点踩点踩

7

帖子

3

主题

0

精华

入门

F 币
36 元
贡献
20 点
沙发
 楼主| 发表于 2018-10-18 15:57:53 | 只看该作者
明白了,那个“save”和“quit”是自己写的过程名。。。还以为是编译器已经给写好的。。。

954

帖子

0

主题

0

精华

大师

F 币
184 元
贡献
75 点

规矩勋章元老勋章新人勋章水王勋章热心勋章

QQ
板凳
发表于 2018-10-18 16:16:01 | 只看该作者
这俩函数需要你自己写。写俩空白的就好了。
[Fortran] 纯文本查看 复制代码
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

7

帖子

3

主题

0

精华

入门

F 币
36 元
贡献
20 点
地板
 楼主| 发表于 2018-10-22 15:00:44 | 只看该作者
谢谢回答,明白了
您需要登录后才可以回帖 登录 | 极速注册

本版积分规则

捐赠本站|Archiver|关于我们 About Us|小黑屋|Fcode ( 京ICP备18005632-2号 )

GMT+8, 2024-4-20 07:23

Powered by Tencent X3.4

© 2013-2024 Tencent

快速回复 返回顶部 返回列表