Menu

Problems compiling GCBASIC for linux

2009-01-10
2021-02-07
  • Nobody/Anonymous

    Has anyone actually managed this? I'm finding extreme difficulty in getting hold of the right version of FreeBasic now - it's moved on a long way. Is GBASIC still tied to that version?

     
    • Nobody/Anonymous

      Sorry - missed the listing...

      mick@mick-desktop:~/Desktop/gcbasic/Source$ fbc -version
      FreeBASIC Compiler - Version 0.18.5 (04-17-2008) for linux (target:linux)
      Copyright (C) 2004-2008 The FreeBASIC development team.
      Configured with prefix /usr/local

      mick@mick-desktop:~/Desktop/gcbasic/Source$ fbc -arch 586 -exx -lang qb GCBASIC.BAS
      GCBASIC.BAS(106) error 67: Array not dimensioned, before '('
      IF DIR$("ERRORS.TXT") <> "" THEN KILL "ERRORS.TXT"
              ^
      GCBASIC.BAS(460) error 67: Array not dimensioned, before '('
        IF INSTR(T$, ";") <> 0 THEN T$ = TRIM$(LEFT$(T$, INSTR(T$, ";") - 1))
                                               ^
      GCBASIC.BAS(729) error 67: Array not dimensioned, before '('
        M$ = TRIM$(MID$(T$, INSTR(T$, "?")+1))
                   ^
      GCBASIC.BAS(799) error 67: Array not dimensioned, before '('
      IF DIR$("compiled.err") <> "" THEN
               ^
      GCBASIC.BAS(839) error 67: Array not dimensioned, before '('
         T$ = TRIM$(UCASE$(PROG$(PD%)))
                    ^
      GCBASIC.BAS(842) error 67: Array not dimensioned, before '('
         V$ = TRIM$(V$)
                    ^
      GCBASIC.BAS(864) warning 25(0): Overflow in constant conversion
      GCBASIC.BAS(888) error 67: Array not dimensioned, before '('
      T2$ = UCASE$(TRIM$(T$))
                          ^
      GCBASIC.BAS(1150) error 67: Array not dimensioned, before '('
         IF UCASE$(TRIM$(DataTables$(CD%))) = UCASE$(TRIM$(TN$)) THEN T% = 1: EXIT FOR
                         ^
      GCBASIC.BAS(1840) error 67: Array not dimensioned, before '('
        IF VarFound% <> 0 AND UCASE$(TRIM$(VarType$(VarFound%))) <> "" AND UCASE$(Ty$) <> "" AND UCASE$(TRIM$(VarType$(VarFound%))) <> UCASE$(Ty$) THEN
                                           ^
      GCBASIC.BAS(1986) error 67: Array not dimensioned, before '('
         V$ = TRIM$(MID$(DS$, 5))
                    ^
      GCBASIC.BAS(1986) error 123: Too many errors, exiting

       
    • mick

      mick - 2009-01-12

      Thanks for the info. I've got it to compile now, but the resulting executable doesn't run :-(   It appears to be set as executable ok.

      I had 2 errors caused by missing libs. I needed to install libc6-dev and libncurses5-dev to get this far.

      Running GCBASIC from a terminal I get this:

      mick@mick-desktop:~/Desktop/gcbasic$ GCBASIC
      bash: GCBASIC: command not found

       
    • Nobody/Anonymous

      I tried to run gcbasic on a terminal window with wine. The compiler produces an assembler file from one of the demos, but I get an error message:
      ----------------------------------------------------------------------------------
      wine gcbasic.exe BlinkLED.txt
      Great Cow BASIC (0.9 10/2/2007)

      Compiling BlinkLED.txt ...
      An error has been found:

      INVALID PWM FREQUENCY VALUE

      The message has been logged to the file E:\media\32_00_00\laptop\elektronik\pic\greatcowbasic-source\ERRORS.TXT.

      Press any key to continue
      --------------------------------------------------------------------------------
      Next I tried to assemble the resulting file with gpasm:

      gpasm BlinkLED.asm
      BlinkLED.asm:10:Warning [230] found lower case match for include filename
      BlinkLED.asm:15:Error [103] syntax error
      BlinkLED.asm:47:Message [302] Register in operand not in bank 0. Ensure bank bits are correct.
      BlinkLED.asm:49:Message [302] Register in operand not in bank 0. Ensure bank bits are correct.
      BlinkLED.asm:75:Message [302] Register in operand not in bank 0. Ensure bank bits are correct.
      BlinkLED.asm:95:Error [113] Symbol not previously defined (Delay_MS).
      BlinkLED.asm:109:Message [302] Register in operand not in bank 0. Ensure bank bits are correct.
      BlinkLED.asm:110:Message [302] Register in operand not in bank 0. Ensure bank bits are correct.
      BlinkLED.asm:111:Message [302] Register in operand not in bank 0. Ensure bank bits are correct.
      BlinkLED.asm:112:Message [302] Register in operand not in bank 0. Ensure bank bits are correct.
      BlinkLED.asm:113:Message [302] Register in operand not in bank 0. Ensure bank bits are correct.

      What is wrong?
      Nili.

       
    • Hugh Considine

      Hugh Considine - 2009-01-19

      I've just compiled and run GCBASIC on Ubuntu 8.10, this is how:

      1. Downloaded FreeBASIC 0.20 from http://downloads.sourceforge.net/fbc/FreeBASIC-v0.20.0b-linux.tar.gz?download
      2. Copied the latest version of GCBASIC onto the PC, which you can obtain from http://gcbasic.sourceforge.net/newfiles/update.zip
      3. Installed libncurses5-dev from Synaptic. (Those using other distros may need to use a different package manager)
      4. Extracted FreeBASIC to a folder on my desktop (~/Desktop/FreeBASIC).
      5. Placed the latest version of GCBASIC into ~/Desktop/GCBASIC
      6. Opened a terminal, switched to the GCBASIC folder, and compiled using the command "fbc gcbasic.bas"
      7. Compiled a test program, Demos/Single LED Dimmer.txt, using this command:
      "./gcbasic Demos/Single\ LED\ Dimmer.txt"

      I had previously installed gcc, so if you get any errors trying to compile GCBASIC (step 6), try installing gcc and binutils and see if that helps.

      Also, you should probably make a configuration file for GCBASIC. To do this, rename "sample gcbasic.ini" to "gcbasic.ini", then comment out or delete these lines:

      Line 17: Assembler = mpasm\mpasmwin
      Line 19: AssemblerParams = /c- /o- /q+ /l+ /x- /w1 "%FileName%"
      Line 26: Programmer = icprog
      Line 27: ProgrammerParams = -l"%FileName%"

      And uncomment Line 21, Assembler = GCASM. This will tell GCBASIC to use its internal assembler, which saves you having to set up the command line parameters for gputils.

       
    • Nobody/Anonymous

      Thanks a lot, Hugh.

      gcbasic.bas doesn't compile with freebasic020,
      cannot find -lfb

      but changing the lines in gcbasic.ini works:

      Line 17: Assembler = mpasm\mpasmwin
      Line 19: AssemblerParams = /c- /o- /q+ /l+ /x- /w1 "%FileName%"
      Line 26: Programmer = icprog
      Line 27: ProgrammerParams = -l"%FileName%"

      I still use the windows version with wine and then call gpasm, which works now.
      Nili

       
      • Hugh Considine

        Hugh Considine - 2009-01-20

        Did you run the install script for FreeBASIC as root?

        If not, and you're using Ubuntu, Debian or similar, open a terminal, go to the folder where you extracted FreeBASIC, and run this:

        sudo ./install.sh -i

        This should install the missing library. If you're using another distribution you might need a different command, I'm pretty new to Linux myself so I can't really help.

         
    • mick

      mick - 2009-01-19

      Thanks folks - still problems here.
      Using Ubuntu 8.04 with FreeBASIC & GCBASIC from Hugh's links.
      libncurses5-dev is installed.

      mick@mick-desktop:~/Desktop/GCBASIC$ fbc gcbasic.bas
      gcbasic.bas() error 24: File not found, libsupc++.a
      ld: cannot find -lsupc++
      mick@mick-desktop:~/Desktop/GCBASIC$

      It looks like libsupc++.a is part of gcc, but I already have gcc installed 3 times by default! (different versions!).

      I'm getting closer though...
      Using FreeBASIC 0.16 with the latest GCBASIC I can get it to compile. But I get this when running it with the command ./GCBASIC :
      Cannot find /home/mick/Desktop/GCBASIC/messages.dat! Great Cow BASIC cannot operate
      without this file.

      Press any key to continue

      The directory is named GCBASIC and certainly does contain messages.dat, as GCBASIC is in the same one!

      If I run the windows exe file in wine 0.9.59 it *appears* to be ok, but if I try to compile a demo:

      mick@mick-desktop:~/Desktop/GCBASIC$ wine gcbasic.exe flasher.txt
      Great Cow BASIC (0.9 10/2/2007)

      Compiling flasher.txt ...
      An error has been found:

      INVALID PWM FREQUENCY VALUE

      The message has been logged to the file Z:\home\mick\Desktop\GCBASIC\ERRORS.TXT.

      Press any key to continue

      It doesn't seem to matter what I compile - line.txt & alarm.txt still have the same PWM error... The asm files are produced yhough, and look ok. ERRORS.TXT is also logging INVALID PWM FREQUENCY VALUE properly.

      curiouser and curiouser...

       
      • Hugh Considine

        Hugh Considine - 2009-01-20

        FreeBASIC 0.16 has a bug in the command which checks if a file exists. It doesn't work reliably with Linux, sometimes it has to be called twice to make it work, sometimes even that doesn't get any results. I'd really recommend you keep trying with 0.18 or 0.20, less trouble in the long run.

        I had a look through the FreeBASIC forum, and found this: http://www.freebasic.net/forum/viewtopic.php?t=11217

        Try installing these libraries, and see if it works:
        sudo aptitude install binutils linux-libc-dev libncurses5-dev libstdc++6-4.1-dev build-essential

        I'm not sure what's causing the PWM error message! If you can't get GCBASIC to compile and run natively, try the latest precompiled version from http://gcbasic.sourceforge.net/newfiles/update.zip and see if that helps.

         
    • mick

      mick - 2009-01-21

      Good news! :-)

      Adding some of the libraries from your first link and changing to FreeBASIC 0.20.0 (08-10-2008) has let me compile the latest GCBASIC (from the update) correctly. The PWM errors aren't happening in the linux version, but I still get them if I try to run the windows exe under wine. Could be a wine problem...

      Thanks - I'm a happy bunny again.  :-)

       
    • Santiago

      Santiago - 2009-01-22

      Great!!...

      It's very easy installing GCBASIC in Ubuntu 8.10.

      Just run in freebasic folder afther extract:

        sudo ./install.sh -i

      Then run in update (GCBASIC) folder afther extrac:

        fbc gcbasic.bas

      And edit  and rename following Hugh's instructions this file:

        sample gcbasic.ini

      Thanks Hugh!!

       
  • Samukelo Shezi

    Samukelo Shezi - 2021-02-07

    I am getting errors while building GCB. The error message screenshot is attached. Any help will be appreciate! Thank you.

     

    Last edit: Samukelo Shezi 2022-04-24

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.