[Solved] Upgrade to TDM MinGW 64bit 5.1.0-2

BlitzMax Forums/Brucey's Modules/[Solved] Upgrade to TDM MinGW 64bit 5.1.0-2

MOBii(Posted 2016) [#1]
Follow this post: Going crazy with Brucey's module :( by Henri

' ----------------------------------------------------------------------------
I finally try upgrade all the mod's

I forgot how I install my MinGW
I think I use to just copy the new MinGW to my MinGW folder.
I download this: tdm-gcc-5.1.0-3.exe this installed map TDM-GCC-32
the structure look the same So I delete/copy my old MinGW folder
C:\Wello\MinGW\lib\gcc\mingw32\5.1.0

I use Brucey's script:
@echo off
@set dirMinGW=C:\Wello\MinGW
@set minGWVersionString=5.1.0
@set dirBlitzmax=C:\BlitzMax

copy %dirMinGW%\bin\ar.exe %dirBlitzmax%\bin /Y
copy %dirMinGW%\bin\ld.exe %dirBlitzmax%\bin /Y

echo "---------------------------------------------------"
for /f "delims=" %%i in ('dir %dirBlitzmax%\lib /b') do (
copy "%dirMinGW%\lib\%%i" "%dirBlitzmax%\lib\%%i" /z /y
copy "%dirMinGW%\lib\gcc\mingw32\%minGWVersionString%\%%i" "%dirBlitzmax%\lib\%%i" /z /y
echo "%dirMinGW%\lib\%%i" "%dirBlitzmax%\lib\%%i"
echo "%dirMinGW%\lib\gcc\mingw32\%minGWVersionString%\%%i" "%dirBlitzmax%\lib\%%i"
)
echo "---[the End]---------------------------------------"
I don't need this script to the new upgraded: bmx-ng

This is the .mod I could not compile!
bah.gdal
bah.libcurlssl
bah.libsmbclient		' This look like Linux
bah.libssh2
bah.libwebsockets
bah.raknet
bah.raknetrooms
bah.raknetvoice
bah.raknetvoicefmod
bah.registry
bah.tesseract
bah.uuid

wx.wxrarinputstream		' I think I could not compile this in gcc 4.7 also
It look like all wx.mod that I currently use is compiled!

But when I try compile my project I get this:
C:/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxscintilla.a(wxscintilla_WordList.o):WordList.cxx:(.text+0x20): multiple definition of `WordList::WordList(bool)'
C:/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxscintilla.a(wxscintilla_WordList.o):WordList.cxx:(.text+0x120): multiple definition of `WordList::~WordList()'
C:/BlitzMax/mod/wx.mod/wxscintilla.mod/wxscintilla.debug.win32.x86.a(LexMax.cxx.debug.win32.x86.o):LexMax.cxx:(.text$_ZN8WordListD1Ev[__ZN8WordListD1Ev]+0x0): first defined here
C:/BlitzMax/mod/wx.mod/wxscintilla.mod/wxscintilla.debug.win32.x86.a(LexMax.cxx.debug.win32.x86.o):LexMax.cxx:(.rdata$_ZTI8LexerMax[__ZTI8LexerMax]+0xa749930c): Cannot get section contents - auto-import exception
C:/BlitzMax/mod/wx.mod/wxscintilla.mod/wxscintilla.debug.win32.x86.a(LexMax.cxx.debug.win32.x86.o):LexMax.cxx:(.rdata$_ZTI14OptionSetBasic[__ZTI14OptionSetBasic]+0x9d264c0c): Cannot get section contents - auto-import exception
C:/BlitzMax/mod/wx.mod/wxscintilla.mod/wxscintilla.debug.win32.x86.a(LexMax.cxx.debug.win32.x86.o):LexMax.cxx:(.rdata$_ZTI9OptionSetI12OptionsBasicE[__ZTI9OptionSetI12OptionsBasicE]+0x74993004): Cannot get section contents - auto-import exception
C:/BlitzMax/mod/wx.mod/wxscintilla.mod/wxscintilla.debug.win32.x86.a(LexMax.cxx.debug.win32.x86.o):LexMax.cxx:(.rdata$_ZTI6ILexer[__ZTI6ILexer]+0xd264bfe4): Cannot get section contents - auto-import exception
C:/BlitzMax/bin/ld.exe: C:/BlitzMax/mod/wx.mod/wxscintilla.mod/wxscintilla.debug.win32.x86.a(LexMax.cxx.debug.win32.x86.o): bad reloc address 0xf in section `.text$_ZN8WordListD1Ev[__ZN8WordListD1Ev]'
Build Error: Failed to link C:\BlitzMax\MOBii\BLL\EDii.debug.exe
This is what I was worried about!
I currently can't continue writing, so I be very grateful if someone know whats wrong?


I use include this in all wx.mod examplefiles to make em work:
Import "Lib/libpthread_s.dll.a"
If I Rem it now I don't get any more ljsj Error


MOBii(Posted 2016) [#2]
I try copy the old wxscintilla.mod and compile it in 5.1.0:
C:/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxscintilla.a(wxscintilla_WordList.o):WordList.cxx:(.text+0x20): multiple definition of `WordList::WordList(bool)'
C:/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxscintilla.a(wxscintilla_WordList.o):WordList.cxx:(.text+0x120): multiple definition of `WordList::~WordList()'
C:/BlitzMax/mod/wx.mod/wxscintilla.mod/wxscintilla.debug.win32.x86.a(LexMax.cxx.debug.win32.x86.o):LexMax.cxx:(.text$_ZN8WordListD1Ev[__ZN8WordListD1Ev]+0x0): first defined here
C:/BlitzMax/mod/wx.mod/wxscintilla.mod/wxscintilla.debug.win32.x86.a(LexMax.cxx.debug.win32.x86.o):LexMax.cxx:(.rdata$_ZTI8LexerMax[__ZTI8LexerMax]+0xa749930c): Cannot get section contents - auto-import exception
C:/BlitzMax/mod/wx.mod/wxscintilla.mod/wxscintilla.debug.win32.x86.a(LexMax.cxx.debug.win32.x86.o):LexMax.cxx:(.rdata$_ZTI14OptionSetBasic[__ZTI14OptionSetBasic]+0x9d264c0c): Cannot get section contents - auto-import exception
C:/BlitzMax/mod/wx.mod/wxscintilla.mod/wxscintilla.debug.win32.x86.a(LexMax.cxx.debug.win32.x86.o):LexMax.cxx:(.rdata$_ZTI9OptionSetI12OptionsBasicE[__ZTI9OptionSetI12OptionsBasicE]+0x74993004): Cannot get section contents - auto-import exception
C:/BlitzMax/mod/wx.mod/wxscintilla.mod/wxscintilla.debug.win32.x86.a(LexMax.cxx.debug.win32.x86.o):LexMax.cxx:(.rdata$_ZTI6ILexer[__ZTI6ILexer]+0xd264bfe4): Cannot get section contents - auto-import exception
C:/BlitzMax/bin/ld.exe: C:/BlitzMax/mod/wx.mod/wxscintilla.mod/wxscintilla.debug.win32.x86.a(LexMax.cxx.debug.win32.x86.o): bad reloc address 0xf in section `.text$_ZN8WordListD1Ev[__ZN8WordListD1Ev]'
Build Error: Failed to link C:\BlitzMax\MOBii\BLL\EDii.debug.exe
It is the same Errors!

Is this the one I suppose to use?:
tdm-gcc-5.1.0-3.exe this installed map TDM-GCC-32

I installed and tested: tdm-gcc-5.1.0.exe and I get the same Error..


Henri(Posted 2016) [#3]
Hi,

something to try: <instructions>. I just tried it myself and seems to be working.

-Henri


MOBii(Posted 2016) [#4]
Thank thee for the instructions it help allot!
It compile all but,
When I compile my project I get:
C:/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxscintilla.a(wxscintilla_WordList.o):WordList.cxx:(.text+0x20): multiple definition of `WordList::WordList(bool)'
C:/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxscintilla.a(wxscintilla_WordList.o):WordList.cxx:(.text+0x120): multiple definition of `WordList::~WordList()'
C:/BlitzMax/mod/wx.mod/wxscintilla.mod/wxscintilla.debug.win32.x86.a(LexMax.cxx.debug.win32.x86.o):LexMax.cxx:(.text$_ZN8WordListD1Ev[__ZN8WordListD1Ev]+0x0): first defined here
C:\Wello\MinGW/bin/ld.exe: cannot find -lluajit
Build Error: Failed to link C:/BlitzMax/MOBii/BLL/EDii.debug.exe
I first make bmk-master Threaded and then I compile all mod's to Threaded

And my Final ERROR was:
C:\Wello\MinGW/bin/ld.exe: cannot find -lluajit

Because I never get a Threaded version to work I try to compile a none Threaded version.
But I fail build bmk-master none Threaded, then nothing was working.
So I Backup BlitzMax and reinstall BlitzMax copy the old working mod. and reinstall MinGW.4.7.1

I am paranoid that I can't get my project back up again so I had to go back and see if I could compile my project again!

Tomorrow I can start compile bmk-master again and then all the mod's none Threaded!

Questions:
Shall bmk-master be Threaded or Not?
Shall I compile the mod's Threaded or Not?

I didn't test the sample files for my Threaded version, is it possible it been working just that it was something wrong with zeke.luajit2
I erase the bmk.exe, core.bmk and make.bmk so I need to recompile Threaded again to test!
I think I could replace the original bmk.exe and then I could just compile a new but so Wrong I was!

I want to upgrade special when I see wx.wxFileDropTarget was success compiled!


Henri(Posted 2016) [#5]
Shall bmk-master be Threaded or Not?

Doesn't matter, but I recommend threaded version because it massively speeds up the compilation process.

The enhanced BMK has 2 major advantages: Speed and ability to use local folder for MinGW setup (default is in <yourBMXFolder>\MinGW32).
This negates the possibility of accidentally using the wrong MinGW-files.


Shall I compile the mod's Threaded or Not?


It depends. If you build your mods threading enabled, you get extra files in your mods-folder, which enable you to build threaded programs.
In any case it doesn't effect non-threaded builds.


I didn't test the sample files for my Threaded version, is it possible it been working just that it was something wrong with zeke.luajit2


Yes, the error is most probably related to that.
Where can you download zeke.luajit2 ?


-Henri


Henri(Posted 2016) [#6]
Hmm..I downloaded Zeke's luajit module from https://github.com/bmx-ng/zeke.mod and all the examples seem to work.

-Henri


MOBii(Posted 2016) [#7]
After sleeping 24 hour, totally exhausted!
I restart from a New install and compile all to Threaded version
When I was done I compile Brucey wxscintilla example and it worked, the joy was overwhelming!

Next I try Compile my project again
Then the compiler become totaly upset with: bah.bass
Because I am worry that I can't use BASS library anyhow because of their license so I Rem it out for now!

Then the output from the compilation looks good (No Errors):
Building executable... 
[ 79%] Processing:BLINI.bmx

[ 79%] Processing:Clean.bmx

[ 81%] Compiling:BLINI.bmx.debug.mt.win32.x86.s

[ 82%] Compiling:Clean.bmx.debug.mt.win32.x86.s

flat assembler  version 1.69.14  (97flat assembler  version 1.69.144909 kilobytes memory)
  (974909 kilobytes memory)
4 passes, 32388 bytes.
5 passes, 115321 bytes.
[ 99%] Processing:Wello.bmx

[ 99%] Compiling:Wello.bmx.debug.mt.win32.x86.s

flat assembler  version 1.69.14  (982806 kilobytes memory)
5 passes, 0.3 seconds, 1715095 bytes.
[ 99%] Processing:EDii.bmx

[ 99%] Compiling:EDii.bmx.gui.debug.mt.win32.x86.s

flat assembler  version 1.69.14  (981486 kilobytes memory)
4 passes, 39624 bytes.
[100%] Linking:EDii.debug.exe



It look like he compile my EDii.debug.exe but I get this for me cryptic message in a message box when try run EDii.debug.exe:

Same Error message When Building a Release!


It look like Zeke still working hard on zeke.luajit :: no Lua Errors now!
(Thank thee didn't see you found it too)


MOBii(Posted 2016) [#8]
This is the Import I have in project so far:
Framework wx.wxApp

Import wx.wxClipboard
'Import wx.wxDropSource
'Import wx.wxDropTarget
'Import wx.wxFileDropTarget

Import wx.wxStaticBitmap
Import wx.wxTextDataObject
Import wx.wxTimer
Import wx.wxPanel
Import wx.wxScrolledWindow
Import wx.wxSplitterWindow
Import wx.wxFlatNotebook
Import wx.wxStaticText
Import wx.wxTextEntryDialog
Import wx.wxNumberEntryDialog
'Import wx.wxColourDialog
Import wx.wxScintilla
Import wx.wxButton
Import wx.wxGradientButton
Import wx.wxTextCtrl
Import wx.wxGenericDirCtrl
Import wx.wxSlider
Import wx.wxListBox
'Import wx.wxdropsource
Import wx.wxComboBox
Import wx.wxCheckBox

' ------------------------------------------------------------------------------[BASS.Rem]---
'Import bah.bass
Import bah.volumes
Import brl.oggloader
Import brl.WAVLoader
Import brl.directsoundaudio
Import brl.stream
'Import zeke.luajit1
'Import zeke.luajit2
Import zeke.luajit
Import bah.crypto
Import brl.max2d

Import bah.crypto

Import brl.map
Import brl.LinkedList
Import brl.Retro


I try see if he reach the onInit() in MyApp:
Type MyApp Extends wxApp
	Field BLL:TWello
	Field wth:Int, hth:Int
	Field _theMAX:Int

	Method onInit:Int()
		' First line in my code
		MFrame.MOBii_Writetoini("MOBii.urk", "Test", 1)
		...
	End Method
...
End Type	' /MyApp
I Fale trying to write to file: MOBii.urk, Test = 1 to see if it pass this line before it create the Error popup message,
The program never get to Method onInit:Int()


Is the only option I got to start remove code, to see where it's not working,
or is it anything else I can try?


MOBii(Posted 2016) [#9]
I remove all the code to this, and the popup Error message is Still there!
SuperStrict

Framework wx.wxApp
Import wx.wxFrame

New MyApp.run()

' -------------------------------------------------------------------------------------------
' ---------------------------------------------------------------------------------[MyApp]---
' -------------------------------------------------------------------------------------------
Type MyApp Extends wxApp
	Field BLL:TWello
	Method onInit:Int()
		BLL = TWello(New TWello.Create(,,, 100, 100, 500, 500, wxDEFAULT_FRAME_STYLE))
		BLL.layout()
		BLL.show(True)
		SetTopWindow(BLL)
		Return True
	End Method

End Type	' /MyApp
' -------------------------------------------------------------------------------------------
' --------------------------------------------------------------------------------[/MyApp]---
' -------------------------------------------------------------------------------------------


' --------------------------------------------------------------------------------[TWello]---
Type TWello Extends wxFrame
' *******************************************************************************************
' **                                                                                       **
' **         **      **           ****     **    **   **   **    **   **  ********         **
' **         **      **         **    **   ***   **   **   ***   **   **     **            **
' **         **      **        **      **  ** ** **   **   ** ** **   **     **            **
' **         **  **  **        **      **  **  ****   **   **  ****   **     **            **
' **         ** **** **   **    **    **   **   ***   **   **   ***   **     **            **
' **           **  **     **      ****     **    **   **   **    **   **     **            **
' **                                                                                       **
' *******************************************************************************************

' -------------------------------------------------------------------------------------------
' -------------------------------------------------------------------------[TWello.onInit]---
' -------------------------------------------------------------------------------------------
	Method onInit()
		DebugLog "I was HERE"
	End Method
End Type	' /TWello
The Error popup message is still there!


What I miss out, I might have erase something important for the startup?


Henri(Posted 2016) [#10]
Your example in post 9# doesn't produce any error for me. Did you download 64-bit version of TDM-MinGW setup ?

There is also'.bmx' folder in your program dir. This can be deleted to test if it makes any difference.

-Henri


MOBii(Posted 2016) [#11]
I strip down a example file and it was working, and it look the same
So I move my code to my testmap and plopp it worked there!

hehe I got:
libgcc_s_sjlj-1.dll
libstdc.dll
libstdc++-6.dll
libwinpthread-1.dll

In my Project root map
It's MinGW 4.7.1, I remove them and now I get some other Errors, but the program starts!
wxScintilla LexAccessor.h, it's something wrong setting the Lexer
The menu somehow not working, just gone
I manage to start Lua script and they actually works!
Most part of my project is still working and that it's progress indeed ^^


Thank thee Henri for all your help again, I don't know how I can repay you ever!


MOBii(Posted 2016) [#12]
Henri you should pin/put your guide
so all BlitzMax users could make the Upgrade, it's more or less the most important guide on the site!

and add/clarify your own advice:
Upgrade to: TDM MinGW 64bit 5.1.0-2
Compile the bmk-master to Threaded and build all mod's to Threaded version!

If you know all this you don't need to be afraid to upgrade anymore!
I was afraid for about 4 month, before I dare to try!

I store 5 copy: old, old2, none Threaded, and Threaded of my BlitzMax directory's, and then I install a new clean BlitzMax + the map for all the mod download's
I have 7 copy of difference MinGW, I probably can start erase all this someday?
Then I Remove the old MinGW Environment Variables
Then I had to remove all the portable MinGW.dll in my project folder.
So it's one or two reasons to be afraid!
Upgrade BlitzMax has the same feeling as when your computer break down (you feel sick)!