1. MGRX Graphics Library - Help Please
- Posted by Icy_Viking May 13, 2021
- 1154 views
- Last edited May 16, 2021
Hello all,
I recently came across the MGRX library. A port of a graphics library called GRX. It is a graphics library that is low-level was used for DOS programming. However this new port allows Win32, Linux, ARM and a couple other platforms. I noticed it doesn't come in DLL or an easy to build for DLL form, so making a wrapper for it will take some work, but I think it would be neat.
Making a DLL out of the existing C code shouldn't be too difficult, might be tedious, but should be possible. Then a wrapper for Euphoria/Phix could be made.
Can someone help me? Perhaps a build this into a DLL or library file. I've tried everything and I can't get it to build.
2. Re: MGRX Graphics Library
- Posted by ghaberek (admin) May 14, 2021
- 1077 views
Making a DLL out of the existing C code shouldn't be too difficult, might be tedious, but should be possible. Then a wrapper for Euphoria/Phix could be made.
I found this in the readme:
- For linux framebuffer and X11 select shared or static libraries. By default only the static libraries are build (and it is the recomended option). To build the shared libraries set INCLUDE_SHARED_SUPPORT=y
So at least on Linux you should be able to build a shared library (this ends up in lib/unix/libmgrxX.so.1).
sudo apt install libjpeg-dev libpng-dev zlib1g-dev tar xzf mgrx134.tar.gz && cd mgrx134 make -f makefile.x11 INCLUDE_SHARED_SUPPORT=y
Still not sure what to do for Windows since there's no shared library option in makefile.w32.
You might be able to just bind the static library into a DLL like this, but I haven't tried it yet.
mingw32-make -f makefile.w32 gcc -shared -o lib/win32/libmgrx.dll -Wl,--whole-archive lib/win32/libmgrx.a -Wl,--no-whole-archive -ljpeg -lpng -lz
If you get "PIC" errors then you might need to rebuild with "CCOPT=-fPIC -D__SHARED__" added to that make command.
-Greg
3. Re: MGRX Graphics Library
- Posted by Icy_Viking May 14, 2021
- 1044 views
- Last edited May 15, 2021
I keep getting the error No rule to make target 'makedefs.grx' Stop
I tried compiling it using Mingw32 as it says in the readme. I could the try the other method I had mind. This was to edit the source code so it would compile as a DLL, but that would be tedious, but possible. Just annoying, heh. I might have to do that.
EDIT: After using chocolatey to install GNU make. I was able to get make to be universal across command prompts. However I now get this error when trying to build the w3w file.
'Error on line 82: expecting depeendices :'