0

我找不到让Allegro5在 Windows 上与FreeBasic一起工作的方法。
我下载并安装了 FreeBASIC-1.05.0-win32.exe。
我下载了 Allegro 二进制文件 allegro-5.0.10-mingw-4.7.0。
安装的 fbc 版本是独立版本。我创建了 allegrolibs 文件夹并将这些库从 Allegro 发行版复制到 allegrolibs:

  liballegro_5.0.10-md.a  
  liballegro_font-5.0.10-md.a  
  liballegro_ttf-5.0.10-md.a  

我将 Allegro 发行版中必要的 allegro dll 添加到示例/图形/allegro:

  allegro_font-5.0.10-md.dll  
  allegro_ttf-5.0.10-md.dll  
  allegro-5.0.10-md.dll

我从命令行运行 fbc,尝试从examples/graphics/allegro5 编译hello.bas:

 fbc -s gui -p allegrolibs examples/graphics/allegro5/hello.bas

该程序编译得很好。
但是,在运行时 hello.exe 向我显示此错误:

  The program can't start because libgcc_s_dw2_1.dll is missing from your computer. 

将 FreeBASIC\bin\win32 中的 libgcc_s_dw2_1.dll 复制到 hello.exe 所在的文件夹,然后运行:

  The program can't start because libstdc++-6.dll is missing from your computer.  

从 ming4.7.0 二进制发行版添加 libstdc++-6.dll 然后运行:

  The program can't start because libgcc_s_sjlj-1.dll is missing from your computer.  

从 ming4.7.0 二进制发行版中添加 libgcc_s_sjlj-1.dll 然后运行:

  The program can't start because libwinpthread-1.dll is missing from your computer.  

从 ming4.7.0 二进制分发中添加 libwinpthread-1.dll 然后运行:

  The procedure entry point __gxx_personality_v0 could not be located
  in the dynamic link library libstd++-6.dll.

在这一点上,我被困住了。我做错了什么?任何尝试过相同并能够解决它的人愿意帮助解决这个问题吗?

4

1 回答 1

0

用于 Windows 的 allegro-5.0.10-mingw-4.7.0 二进制文件是使用 mingw-4.7.0 编译器编译的。
freeBASIC 是用 mingw-w64 编译器编译的。但就动态链接而言,它们可以一起工作。Windows allegro-5.0.10-mingw-4.7.0 的二进制包包括两个文件:

allegro-5.0.10-monolith-mt.dll
liballegro-5.0.10-monolith-mt.a

它们中的任何一个都可用于将 Allegro 5 库链接到 exe:
将 allegro-5.0.10-monolith-mt.dll 或 liballegro-5.0.10-monolith-mt.a 复制到 allegrolib 文件夹中。修改 allegro.bi、allegro_font.bi、allegro_ttf.bi 将第 35 行替换为:

#inclib "allegro-5.0.10-monolith-mt" 

从控制台运行:

fbc -s gui -p allegrolib examples/graphics/allegro5/hello.bas

allegro-5.0.10-monolith-mt.dll 需要与 hello.exe 放在同一个文件夹中。

于 2016-11-08T11:15:09.973 回答