0

I cannot find a way to make Allegro5 work with FreeBasic on Windows.
I downloaded and installed FreeBASIC-1.05.0-win32.exe.
I downloaded Allegro binaries allegro-5.0.10-mingw-4.7.0.
The version of fbc installed is the standalone one. I created allegrolibs folder and copied these libraries from the Allegro distribution to allegrolibs:

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

I added the necessary allegro dlls from the Allegro distribution to examples/graphics/allegro:

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

I run fbc from the command line, trying to compile hello.bas from examples/graphics/allegro5:

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

The program compiled just fine.
However, at runtime hello.exe shows me this error:

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

Copy libgcc_s_dw2_1.dll from FreeBASIC\bin\win32 to the folder where hello.exe resides, then run:

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

Add libstdc++-6.dll from a ming4.7.0 binary distribution then run:

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

Add libgcc_s_sjlj-1.dll from ming4.7.0 binary distribution then run:

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

Add libwinpthread-1.dll from ming4.7.0 binary distribution then run:

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

At this point I'm stuck. What is it that I'm doing wrong? Anybody who tried the same and was able to solved it is willing to help with the issue?

kataz
  • 1
  • 1

1 Answers1

0

allegro-5.0.10-mingw-4.7.0 binary for Windows was compiled with mingw-4.7.0 compiler.
freeBASIC was compiled with a mingw-w64 compiler. But as far as dynamic linking, they can work together. The binary package for Windows allegro-5.0.10-mingw-4.7.0 contains among many other things two files:

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

Either of them can be used to link Allegro 5 library to the exe:
Copy allegro-5.0.10-monolith-mt.dll or liballegro-5.0.10-monolith-mt.a in allegrolib folder. Modify allegro.bi, allegro_font.bi, allegro_ttf.bi replacing line 35 with:

#inclib "allegro-5.0.10-monolith-mt" 

Run from the console:

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

allegro-5.0.10-monolith-mt.dll needs to be placed in the same folder with hello.exe.

kataz
  • 1
  • 1