How to build modules with MinGW?

BlitzMax Forums/BlitzMax Programming/How to build modules with MinGW?

const(Posted 2016) [#1]
I have searched this thing but still having problems. I have installed the MinGW from here. https://sourceforge.net/projects/mingw/

This is the version of the compiler installed.
g++ -v
...various information...
gcc version 4.9.3 (GCC)


Then I go to this directory ...\BlitzMax\bin and type
bmk makemods -r


I see a lot of information about building the modules.

Now when I try to compile a Blitzmax program I get this information. I looks like I messed up the modules for good now.

D:/Programs/BlitzMax/mod/pub.mod/stdc.mod/stdc.debug.win32.x86.a(stdc.c.debug.win32.x86.o):stdc.c:(.text+0x3a9): undefined reference to `__mingw__wopendir'
D:/Programs/BlitzMax/mod/pub.mod/stdc.mod/stdc.debug.win32.x86.a(stdc.c.debug.win32.x86.o):stdc.c:(.text+0x3c4): undefined reference to `__mingw_opendir'
D:/Programs/BlitzMax/mod/pub.mod/stdc.mod/stdc.debug.win32.x86.a(stdc.c.debug.win32.x86.o):stdc.c:(.text+0x3e6): undefined reference to `__mingw__wclosedir'
D:/Programs/BlitzMax/mod/pub.mod/stdc.mod/stdc.debug.win32.x86.a(stdc.c.debug.win32.x86.o):stdc.c:(.text+0x3f9): undefined reference to `__mingw_closedir'
D:/Programs/BlitzMax/mod/pub.mod/stdc.mod/stdc.debug.win32.x86.a(stdc.c.debug.win32.x86.o):stdc.c:(.text+0x41c): undefined reference to `__mingw__wreaddir'
D:/Programs/BlitzMax/mod/pub.mod/stdc.mod/stdc.debug.win32.x86.a(stdc.c.debug.win32.x86.o):stdc.c:(.text+0x44d): undefined reference to `__mingw_readdir'


What version of MinGW do you use? Do you think I might try to make a manual installation of the GCC 4.5?
https://sourceforge.net/projects/mingw/files/MinGW/Base/gcc/Version4/


Henri(Posted 2016) [#2]
Hi,

you could try this as a starting point: http://www.blitzmax.com/Community/posts.php?topic=95220

-Henri


const(Posted 2016) [#3]
Hi Henri, I was able to fix the problem by a workaround. I re installed Blitzmax but this time I built only exactly the mods I was interested. I will avoid building all of the mods again since there might an incompatibility occur.

My theory on this problem is that Windows Blitzmax was compiled with a specific MinGW version and the binary components of it are compatible with that version.

This is a common problem with C++ projects, I noticed. Where a library (i.e. SFML) that was compiled with MinGW 4.7 won't be 100% compatible in a MinGW 4.9 project. So the most preferred way is to build everything from scratch (CMAKE) and be cool.


RustyKristi(Posted 2016) [#4]
Best version to install for MinGW is 4.8.1 for vanilla. I think there's a tutorial somewhere pointing to that version where it also has a override libs and toolchain binaries install.


Henri(Posted 2016) [#5]
Yes, you correct. Different versions have compatibility issues and the libraries in Blitzmax lib folder are from older distribution. But if you replace those lib files with same lib files from MinGW folder and also the bin tools ar and ld in bin folder and build all modules then everything should be ok. Problems come if you miss one file, or 3rd party modules has prebuild files which were build with a different version.

-Henri


Derron(Posted 2016) [#6]
If you only compile modules you need...you mix up variants...as you already described...
Find a MinGW working for you...and compile all modules with it.

If you use Bruceys BMK drop-in-replacement you could have a MinGW32 folder in you Blitzmax folder and should no longer be required to adjust the files in the Blitzmax/lib folder.


Bye
Ron