please help- compiling third party blitzmax code.

BlitzMax Forums/MaxGUI Module/please help- compiling third party blitzmax code.

aravindrobotix(Posted 2015) [#1]
https://github.com/thomaspreece10/SuperEasy-A4S

Hi guys,
The above link which i have mentioned is a server application done in blitzmax since i am new to this programming software i am not able to compile the files. i have done till building the required modules for the application. Can someone help me by giving a detailed step by step instructions on how to compile the code so that i could make adjustments in the code according to my need.

Please Help!!


Henri(Posted 2015) [#2]
Hi,

basic steps are:

1. Download & Install Blitzmax (preferably to C:\Blitzmax)

2. Download & setup MinGW. If MinGW version is showing in MaxIDE's "Help/About MaxIDE" dialog then you probably succeeded :-). MinGW is used to build all the dependency modules needed. There are couple of different versions out there, but I'd recommend either TDM 32Bit ver. 4.71 or the newest 5.1 I'd recommend TDM 64Bit 5.1.0

3. Download all the needed modules from GitHub.

4. From MaxIDE do a "Build all modules"


Most likely there are going to be some hicups so we'll try to tackle them one by one. There are already detailed instructions for each step if you search the forum, but if you get stuck do tell :-)

-Henri


aravindrobotix(Posted 2015) [#3]
Hi Henri,

As per your instruction i have build all the modules in the blitzmax ide without any errors but I dont know how to proceed further like Which bmx code should i compile to get the output. Do I need to place any other supporting files into specific location from the github file?

Please help!!!


Floyd(Posted 2015) [#4]
The readme file says there are pre-compiled versions included. In the same folder I see

A4S-32.bmx	Restructured the code to make it simpler to understand and change. Th…	4 months ago
A4S-32.exe	Updated version numbers on A4S-Helper and recompiled

which apparently means you compile A4S-32.bmx to get A4S-32.exe.


aravindrobotix(Posted 2015) [#5]
When i compile i get the following error. Can anyone help me on this?

Building A4S-32
Compiling:A4S-32.bmx
flat assembler version 1.69.14 (1088922 kilobytes memory)
4 passes, 0.3 seconds, 151084 bytes.
Linking:A4S-32.debug.exe
C:/BlitzMax/bin/ld.exe: cannot find -lsetupapi
Build Error: Failed to link G:/thomaspreece github/Code/A4S-Helper/A4S-32.debug.exe
Process complete


Floyd(Posted 2015) [#6]
The error message is from the linker, complaining that it cannot find a library named setupapi.

From comments I have seen elsewhere this is supposed to be distributed with MingGW. So I don't know why it isn't found.


Henri(Posted 2015) [#7]
Most likely your MinGW-setup is incomplite. Here is a current setup guide. Guide is using Windows .bat script to copy needed files, but could also copy by hand. Blitzmax comes bundled with older version of MinGW (mainly the ld.exe & ar.exe & lib-files from lib-folder) so if a single file is misplaced or not copied over there could be version mismatch related errors.

-Henri


aravindrobotix(Posted 2015) [#8]
I am using the latest minGW 5.1. When i copied the files as mention above in the setup guide i get the following error.

please help!!!

C:/BlitzMax/bin/ld.exe: C:/BlitzMax/mod/bah.mod/serial.mod/serial.debug.win32.x86.a(glue.cpp.debug.win32.x86.o): bad reloc address 0x4 in section `.text$_ZN6serial7Timeout3maxEv[__ZN6serial7Timeout3maxEv]'
C:/BlitzMax/bin/ld.exe: final link failed: Invalid operation
Build Error: Failed to link C:/Users/Admin/Desktop/A4S-Helper/A4S-32.debug.exe
Process complete


Henri(Posted 2015) [#9]
I have to do module rebuilding myself in order to test the file, but in the meantime could you test any sample code that came with Blitzmax to verify that basics work ?

-Henri


aravindrobotix(Posted 2015) [#10]
yeah I am able to compile the codes given in the sample...


aravindrobotix(Posted 2015) [#11]
But I am not able to compile the example files in the serial.mod and regex.mod. i get errors in them.


Floyd(Posted 2015) [#12]
But I am not able to compile the example files in the serial.mod and regex.mod. i get errors in them.

Those are both Brucey's mods. If you could not compile the modules then you certainly can't compile examples which use them.

I had a quick look at serial.mod and saw a file with a .cc extension. This is C++, which usually has a .cpp extension but sometimes .cc is used. I don't know why. This is a hint that BlitzMax's default bmk.exe will have trouble. Anyway, Brucey made his own version of bmk to deal with this. You compile it using the original bmk. Then replace the old bmk with the new one. I haven't looked at this in ages so someone else will have to advise you.

I think this is the latest: https://github.com/bmx-ng/bmk

There are instructions at the bottom of the page.


Henri(Posted 2015) [#13]
Ok, it took a little while but got through it.

The culprit was the 32bit TDM version. When I installed newest (5.1.0) 64bit version I was able to compile and run everything.

Some minor hicups with wxMax on the way as seen in this thread.

-Henri


aravindrobotix(Posted 2015) [#14]
When i install 64 bit mingw on a 32 bit system, will that work?? and do i need to rebuild all the modules again?


Henri(Posted 2015) [#15]
Yes, it contains libraries for both 32Bit and 64Bit and yes, you have build everything again, because there is a slight difference between the two.


Just to recap what I did:


Instructions to use Bruceys modules and enhanced version of Blitzmax maketool bmk.

1. Install Blitzmax 1.50 to C:\Blitzmax

2. Install TDM MinGW 64bit 5.1.0 found in http://tdm-gcc.tdragon.net/download to C:\Blitzmax\MinGW32

3. Download enhanced bmk from https://github.com/bmx-ng/bmk . Follow the instructions provided there on how to deploy.

4. Download patched pub & brl mods from https://github.com/maxmods and replace the originals in C:\Blitzmax\mod

5. From MaxIDE select menu "Program/Rebuild All Modules". To test that everything is running fine, select a sample from MaxIDE's right panel "Projects/Samples" and run it.

* NOTE: Bmk NG is using the libraries and bin utils(ar.exe & ld.exe) in C:\Blitzmax\MinGW32-folder so the ones in Blitzmax folder are not needed (those can be deleted/relocated to test this)

*NOTE 2: If you get compile error concerning MaxGUI see this post

6. Download Brucey's modules from https://github.com/maxmods and copy them in C:\Blitzmax\mod folder (remember to remove the -master suffix as every module should end in .mod). Probably best to copy only those that are needed for simplicitys sake.

* NOTE: Modules can be copied one at the time and then do step 7. Save wxMax for (if needed) last because it's huge and takes longest time to compile.

* NOTE 2: If you get compile error concerning wx.rarinputstream then add this line..
#include <stdint.h>
..in wxrarinputstream.mod\src\unrar\crc.hpp file.

7. From MaxIDE select menu "Program/Build Modules". No need to do a complite rebuilding at this point.

8. Finally select menu "Program/Rebuild Documentation"


OK. Now everything should be good to go :-)



-Henri


Henri(Posted 2015) [#16]
One last note:

I noticed that there are 3 dll files (lib*.dll) inside Code\A4S-Helper folder, which need to be deleted, so that they wont conflict with the ones inside Blitzmax folder. Those files come with MinGW.

-Henri