Setting up ANY gui for A5
Johan Halmén

I have set up A5 on a laptop. I use CodeBlocks and mingw64 and everything seems to work. At this point I'd like to include a gui library that works nicely with A5. Since A5 includes stuff like event handling, it would be nice if the gui library wouldn't ignore A5's event system, but would instead build on it. It would also be nice if the library could be easily built without rewriting a lot of makefiles which originally was written for VisualStudio.

Do I have to build the lib from source or are there binaries available for any setup of Windows compilers and architecture (32 vs 64)? Since I prefer an IDE over command line and makefile stuff, I know nothing about creating and rewriting makefiles. It's in my todo list to learn to use all that stuff, but so far I haven't found any resources for self studies. But that's really another discussion. Right now I'd like to have a working gui lib installed together with A5/Codeblocks/mingw64. Any help would be nice. The first one to recommend their own gui together with a step-by-step guide will have a devoted user, always recommending their lib in all gui discussions. :)

Chris Katko

What do you mean by GUI? A bitmap dialog system inside Allegro 5, or interfacing with Windows/Linux/etc operating system GUI? (ala Allegro 5 inside a normal dialog for a tool.)

jmasterx
Johan Halmén

What do you mean by GUI?

An AGUI like library. I'm pretty sure AGUI is the library I'll be using, if I only get it installed. Must work through that first link you provided, jmasterx. Thanks for that, and thanks for the lib itself.

<edit>
Ok, I'm on my way. I got Cmake to create a codeblocks project file. But I have no idea if I got everything right there. Cmake seems to have accepted all settings.

But in Codeblocks I got this annoying error:

fatal error: allegro5/allegro.h: No such file or directory

And it points to Allegro5Font.hpp. Codeblocks normally offers path settings either for the IDE itself or for the particular project. But in this project I can't set the project's own search paths, only the IDE paths, which won't affect this problem.

<edit>
Ok, now I got Codeblocks to compile and build everything with just 4 warnings. Haven't checked that yet. It required me to add line 116 in CMakeList.txt:

include_directories ("C:\CodeBlocks\mingw64\include")

...because that's where I have the A5 stuff. While all AGUI stuff is in a completely other directory, where I wish to build the lib files.

<edit>
Crashing. First I had wrong lib order for the linking. Obviously these new agui libs must come before the allegro libs. But when I finally had my exe done (from agui_example), it crashed. I tried to place the data folder in the right place, but launching from Windows gives me a complaint about missing libgcc_s_seh-1.dll. What's that?

Edgar Reynaldo

You might need to copy the lib_gcc_seh or whatever dll from your /mingw/bin folder along with libstd_c++ with your executable files.

Johan Halmén

Damn! I had wished I could create statically linked stuff. Is there something fundamentally dll oriented in AGUI or can one create static libraries out of the files? I throw in whatever dll files it asks, so far libgcc_s_seh-1.dll and libwinpthread-1.dll. Right now it just crashes without asking for more dll:s.

jmasterx

I'm able to static link Agui with MSVC, I imagine the same is possible with g++.
Maybe use depends http://www.dependencywalker.com/ to see what it needs.

Johan Halmén

And I might need the latest version of AGUI. Found out there's one from 2015, while I seem to have some from 2012.

jmasterx

Get latest git sources. They are the most stable.

Polybios
jmasterx said:

Maybe use depends http://www.dependencywalker.com/ to see what it needs.

You might also be able to simply use the ldd script if that comes with your version of mingw64.

Johan Halmén

I'm working with the latest git sources. I get this error in gui.cpp:

error: call of overloaded 'abs(double&)' is ambiguous

And then it suggests a bunch of candidates, all of which are different ints, but no floats. Anyway, since abs is not ambiguous at all, any library should do. So I just put std:: in front of each occurrence of abs, there are three of them.

<edit>
Working! Still don't know which dll files I might have to include, but that's no problem. If dll files are meant to be included in any distribution of any program I create, then so be it.

Thread #616856. Printed from Allegro.cc