GLBasic forum

Main forum => GLBasic - en => Topic started by: Amon on 2010-Nov-10

Title: Can't compile anything or build anything with the ide.
Post by: Amon on 2010-Nov-10
Hi I updated to the latest version and I can't seem to compile or build. Even if I put a simple while loop it just doesn't want to compile or build and rung the app?

Any ideas as to what could be wrong?
Title: Re: Can't compile anything or build anything with the ide.
Post by: Synthetic on 2010-Nov-10
Is is giving you any specific errors?
Title: Re: Can't compile anything or build anything with the ide.
Post by: okee on 2010-Nov-10
Or did you install mingw
Title: Re: Can't compile anything or build anything with the ide.
Post by: Amon on 2010-Nov-10
I have MinGW installed because it's needed by BlitzMax. As for error messages it doesn't bring up anything, no popup or console message other than Build 1 0 succeded.
Title: Re: Can't compile anything or build anything with the ide.
Post by: Kitty Hello on 2010-Nov-10
please, post what's in the output text box when you compile. Please also load an example project (gbaP file).
Title: Re: Can't compile anything or build anything with the ide.
Post by: okee on 2010-Nov-10
Amon when I install Mingw and set the paths in environment it causes havoc
with GLBasic, so i just remove the paths and replace them when i need to compile
a module in Blitz.

Title: Re: Can't compile anything or build anything with the ide.
Post by: Kitty Hello on 2010-Nov-10
what environment variables are there changed with mingw?
Title: Re: Can't compile anything or build anything with the ide.
Post by: okee on 2010-Nov-10
MingW doesn't change any environment variables. but i
need to do the following to allow Blitzmax to compile modules

Quote
ANY WINDOWS OS:
1.- Click the start button, right click on 'My Computer' on XP or 'System' on Vista and seven. Then click on 'Properties'. Select the 'Advanced Properties Tab' and at the bottom you will see the 'Environment Variables' button. Click that.
It should open up a new window with two boxes named 'User Variables for blah' and 'System Variables'.

2.- Click 'New' for User Variables and in the 'Variable Name' box type MinGW. In the 'Variable Value' Box enter the path to the MinGW installation ie C:\MinGW. Then click OK.
So environment variables look something like:
(http://www.okcs.net/images/paths.jpg)


Compiling a small program in GLB gives this error
Quote
Wordcount:4 commands
compiling:

linking:
/mingw/lib/crt2.o:crt1.c:(.text+0x28): undefined reference to `___dyn_tls_init_callback'
*** FATAL ERROR - Please post this output in the forum
_______________________________________
*** Finished ***
Elapsed: 1.6 sec. Time: 15:34
Build: 0 succeeded.
*** 1 FAILED ***

I think it may be that GLB finds the c:\MinGW path first
Title: Re: Can't compile anything or build anything with the ide.
Post by: Amon on 2010-Nov-10
Hi! Loading a normal file or any type of file now gives me the same error as okee. It deffo has something to do with MinGW.
Title: Re: Can't compile anything or build anything with the ide.
Post by: MrTAToad on 2010-Nov-10
Thats odd - I've got MinGW installed, and, aside from the Windows CE compiling problem, it doesn't interfere with anything...

My path is :

Code: (glbasic) [Select]
C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;c:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;R:\Qt\2010.05;r:\MinGW\bin;r:\MinGW;R:\SlikSvn\bin\;C:\Program Files (x86)\Windows Live\Shared
and

Code: (glbasic) [Select]
MinGW = R:\MinGW
Title: Re: Can't compile anything or build anything with the ide.
Post by: Amon on 2010-Nov-11
There's still no joy for me. It refuses to compile/build.

I have removed MinGW and reinstalled GLbasic but I get the same error. Sometimes the error doesn't even show in the console.

What is worng with it?
Title: Re: Can't compile anything or build anything with the ide.
Post by: Amon on 2010-Nov-11
Ok, after a bit more messing about it now works properly. I had to completely remove any reference to MinGW i.e. Environment variables, anythign stored in "path" and a clean of the temp folder. After reboot it works fine.

Is there any way to be able to use GLbasic while MinGW is installed? It just seems a bit of a waste of time to have to keep adding MinGW to use blitzMax and removing it in order to use GLBasic.

Title: Re: Can't compile anything or build anything with the ide.
Post by: Kitty Hello on 2010-Nov-11
Don't use BlitzMax :P
Honestly, if you find any environment variable settings (you can start the editor from a command line to test) that allow mingw in c:, please tell me.
Title: Re: Can't compile anything or build anything with the ide.
Post by: MrTAToad on 2010-Nov-11
What was the contents of %PATH% ?
Title: Re: Can't compile anything or build anything with the ide.
Post by: Amon on 2010-Nov-11
The contents of the path file had C:\MinGW\bin in it. 

Quote
C:\Program Files (x86)\ATI Stream\bin\x86_64;C:\Program Files (x86)\ATI Stream\bin\x86;%CommonProgramFiles%\Microsoft Shared\Windows Live;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\MinGW\bin;C:\Applications\Coding\TortoiseSVN\bin;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\MinGW\bin

I'll try what Kitty says now. :)
Title: Re: Can't compile anything or build anything with the ide.
Post by: MrTAToad on 2010-Nov-11
I notice your MinGW is at the end, whilst mine isn't...  Perhaps it worth moving it ?
Title: Re: Can't compile anything or build anything with the ide.
Post by: Amon on 2010-Nov-11
Hi! I put C:\MinGW at the begining of the path and all seems to work fine for now. Will post again if any other problems come up.
Title: Re: Can't compile anything or build anything with the ide.
Post by: Kitty Hello on 2010-Nov-12
uhm - it workend when you put the c:\mingw at the _front_ of the path? :blink:
Title: Re: Can't compile anything or build anything with the ide.
Post by: okee on 2010-Nov-12
I managed to get mine working using an older version of MinGW
version 5.1.3 from here http://www.blide.org/backup/MinGW.rar (http://www.blide.org/backup/MinGW.rar)
Changing the path made no difference
Title: Re: Can't compile anything or build anything with the ide.
Post by: Amon on 2010-Nov-12
Ahh, I went back to the same version as okee. Didn't realise it was that because after installing I moved whereit was stored in the path and when it worked I just assumed it was because I moved it.

Kind of a silly presumption but in my defence it was very late and GLBasic kept me awake....It's that good. :D :p
Title: Re: Can't compile anything or build anything with the ide.
Post by: dawlane on 2010-Nov-13
As this is my first post here on this forum I will start by saying Greetings to all.
As I also use Blitzmax as well as GLBasic and I also had this problem with trying to compile GLbasic applications with MinGW installed with the environment variable set in the default global location (System Properties->Advanced->Environment Variables). My solution was fairly simple: I removed all references to MINGW from the System Environment Variables and then wrote a small batch file that set up the necessary MINGW paths, added these to the PATH variable and then executed the Blitzmax IDE. Doing it this way means it can do two things..

1) Stops any application that has it's own variation of MINGW/GCC (e.g GLBasic) from using any other version of MINGW and its libraries.
2) Allows you to have multiple version of mingw installed.

At the moment I using version 4.5.0 but I also have 3.4.5 as well just in case something doesn't work.

To create a batch file use notepad and copy and paste the file below not forgetting to change a few thing to suit your environment. Then save the file and rename the file extension from a .txt to a .bat. Note to see the file extensions you will have to uncheck "Hide extensions for known file types" that can be found in windows explorer's Folder Options View tab (usually found from the menu bar under Tools->Folder Options on XP or Organize->Folder and Search Options on Vista/Win7).

Code: (glbasic) [Select]
@echo off

rem set the Version of mingw
set MINGW_VER=4.5.0

rem set the default path of mingw
set MINGW=path to MINGW

rem You mostly only need maybe four of the below variables GCC_EXEC_PREFIX (Vista/Win7), MINGW_BIN
rem MINGW_INC and MINGW_LIB. But if you have problems add the others as well.

set GCC_EXEC_PREFIX = %MINGW%\lib\gcc\
set MINGW_BIN=%MINGW%\bin
set MINGW_EXEC=%MINGW%\libexec\gcc\mingw32\%MINGW_VER%
set MINGW_GCC=%MINGW%\lib\gcc\mingw32\%MINGW_VER%
set MINGW_GCC_INC=%MINGW%\lib\gcc\mingw32\%MINGW_VER%\include
set MINGW_INC=%MINGW%\include
set MINGW_LIB=%MINGW%\lib
set MINGW_PATH=%MINGW%;%MINGW_BIN%;%MINGW_INC%;%MINGW_LIB%;%MINGW_EXEC%;%MINGW_GCC%;%MINGW_GCC_INC%;%GCC_EXEC_PREFIX%

rem add the MINGW FILE PATHS to the SYSTEM PATH
set path=%PATH%;%MINGW_PATH%

rem execute the Blitzmax IDE
start /D"Path to BlitzMax" MaxIDE.exe
Title: Re: Can't compile anything or build anything with the ide.
Post by: MrTAToad on 2010-Nov-14
As I mentioned previously, it might be worth changing the order of \MinGW in the %PATH% variable - if it works, should save a lot of trouble :)
Title: Re: Can't compile anything or build anything with the ide.
Post by: okee on 2010-Nov-14
Quote
As I mentioned previously, it might be worth changing the order of \MinGW in the %PATH% variable - if it works, should save a lot of trouble

I don't think that makes a difference, didn't work for me or Amon, what version of MinGW have you installed ?
The conflict seems to be with newer versions of MinGW
Title: Re: Can't compile anything or build anything with the ide.
Post by: MrTAToad on 2010-Nov-15
I'm using the 30/10/2010 version (with updated repositories), and installed C, C++ - all is fine here...
Title: Re: Can't compile anything or build anything with the ide.
Post by: Kitty Hello on 2010-Nov-15
oh - please try to run glbasic editor with that script:

Code: (glbasic) [Select]
SET MINGW_LIB=
SET MINGW_INC=
SET MINGW_EXEC=
SET MINGW_GCC=
SET_MINGW_GCC_INC=
SET MINGW_PATH=
C:\Program Files\GLBasic\Editor_e.exe

It might work then. I hope you can somehow tell the glbasic compiler _not_ to use _any_ mingw path other that what the command line has.
Title: Re: Can't compile anything or build anything with the ide.
Post by: dawlane on 2010-Nov-16
Using a script to start the GLBasic Editor will not work as that was the first thing I tried. From what I can gather it uses a .ini file located in "GLBasic\Compilers\platform" that's used to invoke the selected platform's version of the compiler. As this file is a plain text file it can be edited to be redirected to execute a batch file that can then be use to set up any necessary paths and then execute the compiler.  Of course you will have to do this for every version of the supported compiler that is having problems.

I've already test this out with MINGW's environment variables set within the default system path and every thing seems ok for the Windows build, but a few of the other supported platforms have problems when you try to compile.
If you want to test it out create a batch file in "GLBasic\Compilers\platform\Win32\bin" and copy and paste the code below and then modify every g++.exe in the [win32] section of platforms.ini to g++.bat

Code: (glbasic) [Select]
rem Force GLBasic to Use only GLBasic's Win32 g++ compiler

rem replace PATH TO GLBASIC with your GLBasics path
set GLBASIC=PATH TO GLBASIC
set PLATFORM=%GLBASIC%Compiler\platform\
set Bin=%PLATFORM%Win32\Bin
set lib=%PLATFORM%Win32\lib

rem Make sure to remove GCC_EXEC_PREFIX if it is set within
rem the system environment variables it will break the linker ld
set GCC_EXEC_PREFIX=

set PATH=%bin%;%lib%

rem execute the g++ compiler with verbose output
rem and pass the rest of the command line from platform.ini 
g++.exe -v %*

The down side to doing it this way is you would have to do it every time there was an update. And the only permanent solution would be  down to GLBasics author to solve.
Title: Re: Can't compile anything or build anything with the ide.
Post by: Kitty Hello on 2010-Nov-17
fixed in next update.
Title: Re: Can't compile anything or build anything with the ide.
Post by: dawlane on 2010-Nov-26
I hate to say this Kitty but just updated to 8.174 and it doesn't quite play nicely if you have MinGW set up on a Vista/Windows7 (and possibly XP)  machine and you want to build any OSX, iPhone or DLL projects. After playing around you can still build Win32-DLL's if the MinGW version is 3.4.5 as it still searches the PATH Environment variable any other version of MinGW and building DLL's will fail. Other wise every thing else seems to compile ok on my machines.

If any one is still having problems the work around is still to modify your platform.ini to point to a custom batch file like the one below:
Code: (glbasic) [Select]
rem Force GLBasic to use iPhone Compiler

rem SAVE THIS BATCH FILE TO YOUR "platform\iphone\" ROOT FOLDER AS arm-apple-darwin9-g++.bat

rem Get the absolute path of this batch file
set GLBASIC=%~dp0

rem Set up the paths
set BIN=%GLBASIC%bin
set LIB=%GLBASIC%lib

rem If  GCC_EXEC_PREFIX is set in the system environment variables make sure it's cleared
set GCC_EXEC_PREFIX=

rem set the PATH variable temporarily to point to GLBasic's Compilers tool and library suite
set PATH=%BIN%;%LIB%

rem execute the iphone compiler with verbose output (-v)
arm-apple-darwin9-g++.exe -v %*