GladeToBac compilation problems

New to FreeBASIC? Post your questions here.
Post Reply
wumfi
Posts: 6
Joined: Apr 25, 2017 9:31

GladeToBac compilation problems

Post by wumfi »

Good morning,

I have been struggling all morning here trying to get GladeToBac to run.

This is on a linux (debian) box.

I have installed Glade 3.18.3 and FreeBASIC Compiler 1.05.0. Both of these are running fine.

I downloaded Gladetobac from freebasic-portal.de.

Unzipped the gladetobac file and attempted to compile from src. I had a failure stating the libintl.bi was missing, so I googled and got/created that file - it's odd that I was missing that? Perhaps it's because the software is from a .de site and I'm in the UK (so it's needed for language conversion or something).

When I try to compile, I get a lot of errors which look like basic syntax problems. I suspect however that I am missing something so that the compiler can't find the relevant functions.

I have been googling around but I can't find anything that relates to this. If I've missed something obvious, please forgive me.

Any ideas?

Dump:

Code: Select all

pcundall@crunch:~/downloads/GladeToBac3.2/src$ fbc -w all -s gui GladeToBac.bas
GladeToBac.bas(61) error 9: Expected expression in '#ELSEIF __FB_UNIX__'
GladeToBac.bas(67) error: platform not supported / nicht unterstuetzt!
/home/pcundall/downloads/GladeToBac3.2/src/tobac/on_ActLoad_activate.bas(27) error 41: Variable not declared, SLASH in 'IF LEN(p) = 0 THEN IF SLASH = "/" THEN p = .Xml.LPath ELSE p = .Xml.WPath'
/home/pcundall/downloads/GladeToBac3.2/src/tobac/on_ActLoad_activate.bas(27) error 3: Expected End-of-Line, found 'SLASH' in 'IF LEN(p) = 0 THEN IF SLASH = "/" THEN p = .Xml.LPath ELSE p = .Xml.WPath'
/home/pcundall/downloads/GladeToBac3.2/src/tobac/on_win_main_configure_event.bas(20) warning 3(1): Passing different pointer types, at parameter 2 of GTK_WINDOW_GET_SIZE()
/home/pcundall/downloads/GladeToBac3.2/src/tobac/on_win_main_configure_event.bas(20) warning 3(1): Passing different pointer types, at parameter 3 of GTK_WINDOW_GET_SIZE()
/home/pcundall/downloads/GladeToBac3.2/src/tobac/on_MnuSaPa_activate.bas(20) error 41: Variable not declared, NL in '.RausClr(*__("Save parameters") & NL & NL)'
/home/pcundall/downloads/GladeToBac3.2/src/tobac/on_MnuSaPa_activate.bas(22) error 9: Expected expression, found 'SLASH' in '.Folder(.Xml.Path & SLASH)'
/home/pcundall/downloads/GladeToBac3.2/src/tobac/on_MnuHelp_activate.bas(19) error 9: Expected expression, found 'NL' in '.RausClr(*__("Help function") & NL & NL)'
/home/pcundall/downloads/GladeToBac3.2/src/tobac/on_MnuHelp_activate.bas(23) error 9: Expected expression, found 'NL' in '.Raus(":" & NL & NL)'
/home/pcundall/downloads/GladeToBac3.2/src/tobac/on_MnuHelp_activate.bas(27) error 9: Expected expression, found 'NL' in 't &= z & NL'
/home/pcundall/downloads/GladeToBac3.2/src/tobac/on_MnuHelp_activate.bas(32) error 9: Expected expression, found 'NL' in '.RausBlau(*__("Command-line-help") & NL & NL)'
/home/pcundall/downloads/GladeToBac3.2/src/tobac/on_MnuHelp_activate.bas(32) error 132: Too many errors, exiting
haegartheroot
Posts: 112
Joined: Jul 27, 2007 15:45
Location: Bremen, Germany
Contact:

Re: GladeToBac compilation problems

Post by haegartheroot »

Good evening,

the code is not fully compatible with FreeBasic 1.05.

Change this in the main module GladeToBac.bas:

Code: Select all

#IF DEFINED(__FB_WIN32__)   '<======= change
  '#LIBPATH "C:/opt/Gtk+" ' place path to your GTK-dev here
  #LIBPATH "C:/opt/GTK-2.24.0/lib"
  #DEFINE SLASH "\"
  #DEFINE NL !"\r\n"
  #DEFINE ORDNER "C:\project\"
  #DEFINE EXAMPLE "C:\programs\" & PROJ_NAME & "\bin\" & PROJ_NAME & " "
#ELSEIF DEFINED(__FB_LINUX__)  '<========= change
  #DEFINE SLASH "/"
  #DEFINE NL !"\n"
  #DEFINE ORDNER "~/project/"
  #DEFINE EXAMPLE "/home/user/" & PROJ_NAME & "/" & PROJ_NAME & " "
#ELSE
  #ERROR pla
And add one line / change these lines in FUNCTION codingTobacDef (in the source member GladeToBac_CodeBas.bas:

Code: Select all

FUNCTION codingTobacDef(BYREF W AS STRING, BYREF T AS STRING) AS INTEGER
 var fl  = null  '<=========  add
  WITH _UI_.Xml
 '   VAR fl = STACK_ANZ(.Ref) + LEN(.WiMa)    '<========= change
    fl = STACK_ANZ(.Ref) + LEN(.WiMa)     '<========= change
    IF LEN(.TyNa) THEN '                 
Then it will compile without any errors.

Have fun,
Haegar
wumfi
Posts: 6
Joined: Apr 25, 2017 9:31

Re: GladeToBac compilation problems

Post by wumfi »

Sorry for the delay, but this worked great. Thank you very much!

Pete

EDIT: Looks like I was too quick there! Still having problems. I get a number of warnings (which I assume are ok), and then one error:

Code: Select all

pcundall@crunch:~/downloads/GladeToBac3.2/src$ fbc -w all -s gui GladeToBac.bas
/home/pcundall/downloads/GladeToBac3.2/src/tobac/on_win_main_configure_event.bas(20) warning 3(1): Passing different pointer types, at parameter 2 of GTK_WINDOW_GET_SIZE()
/home/pcundall/downloads/GladeToBac3.2/src/tobac/on_win_main_configure_event.bas(20) warning 3(1): Passing different pointer types, at parameter 3 of GTK_WINDOW_GET_SIZE()
/home/pcundall/downloads/GladeToBac3.2/src/GladeToBac_UI.bas(107) warning 3(1): Passing different pointer types, at parameter 2 of GTK_WINDOW_GET_SIZE()
/home/pcundall/downloads/GladeToBac3.2/src/GladeToBac_UI.bas(107) warning 3(1): Passing different pointer types, at parameter 3 of GTK_WINDOW_GET_SIZE()
/home/pcundall/downloads/GladeToBac3.2/src/GladeToBac_UI.bas(415) error 57: Type mismatch, at parameter 1 (N) of FIN() in 'Xml.PLiz = Liz.fin(n)'
Any ideas?

Thank you again.
Pete
wumfi
Posts: 6
Joined: Apr 25, 2017 9:31

Re: GladeToBac compilation problems

Post by wumfi »

Does anyone have any ideas please?

Pete
haegartheroot
Posts: 112
Joined: Jul 27, 2007 15:45
Location: Bremen, Germany
Contact:

Re: GladeToBac compilation problems

Post by haegartheroot »

Hello Pete,

I have no clue what's going wrong on your side.
Just tried to compile the source on my Ubuntu 16.04 LTS box (in my first answer I used Ubuntu 12.04 LTS) and it works perfectly after having applied the changes I mentioned earlier.
Did you change anything else in the source?
Maybe you should download the source again and apply only the changes shown above ...

//Haegar
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: GladeToBac compilation problems

Post by MrSwiss »

wumfi wrote:EDIT: Looks like I was too quick there! Still having problems. I get a number of warnings (which I assume are ok), and then one error
Can you please supply some more info, such as:
  • 32/64 bit FBC + version
  • OS WIN/LIN + bitness + version
Reason: you guys are probably not speaking: "exactly the same language".
haegartheroot
Posts: 112
Joined: Jul 27, 2007 15:45
Location: Bremen, Germany
Contact:

Re: GladeToBac compilation problems

Post by haegartheroot »

For your info: I am on Ubuntu Linux 16.04 LTS 32-bit + gtk 3.18.9 + glade 3.18.3 + FreeBasic fbc 1.05.0 32-bit.

Here's the proof with an error-free compile:

haegar@fakse:~/Downloads/source/GladeToBac3.2/src$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial
haegar@fakse:~/Downloads/source/GladeToBac3.2/src$ pkg-config --modversion gtk+-3.0
3.18.9
haegar@fakse:~/Downloads/source/GladeToBac3.2/src$ glade --version
glade 3.18.3
haegar@fakse:~/Downloads/source/GladeToBac3.2/src$ fbc -version
FreeBASIC Compiler - Version 1.05.0 (01-31-2016), built for linux-x86 (32bit)
Copyright (C) 2004-2016 The FreeBASIC development team.
haegar@fakse:~/Downloads/source/GladeToBac3.2/src$ fbc -w all -s gui GladeToBac.bas
haegar@fakse:~/Downloads/source/GladeToBac3.2/src$


//Haegar
wumfi
Posts: 6
Joined: Apr 25, 2017 9:31

Re: GladeToBac compilation problems

Post by wumfi »

Hi,

Sorry for the delay in replying, I've been on holiday.

Since my last posts, I've moved across to Linux Mint 18, but I'm still having the same issues.

I've done a complete reinstall of Freebasic, GTK3 and Glade. I also went and grabbed the libintl.bi file from https://raw.githubusercontent.com/freeb ... libintl.bi <-- Not sure why this file is missing from my install?

To answer your questions:

Code: Select all

pcundall@mint ~/Desktop/GladeToBac3.2/src $ lsb_release -a
No LSB modules are available.
Distributor ID: LinuxMint
Description:    Linux Mint 18.1 Serena
Release:        18.1
Codename:       serena
pcundall@mint ~/Desktop/GladeToBac3.2/src $ getconf LONG_BIT
64
pcundall@mint ~/Desktop/GladeToBac3.2/src $ pkg-config --modversion gtk+-3.0
3.18.9
pcundall@mint ~/Desktop/GladeToBac3.2/src $ glade --version
glade 3.18.3
pcundall@mint ~/Desktop/GladeToBac3.2/src $ fbc -version
FreeBASIC Compiler - Version 1.05.0 (01-31-2016), built for linux-x86_64 (64bit)
Copyright (C) 2004-2016 The FreeBASIC development team.
Changes I made as advised:

Code: Select all

#IF DEFINED(__FB_WIN32__)
  '#LIBPATH "C:/opt/Gtk+" ' place path to your GTK-dev here
  #LIBPATH "C:/opt/GTK-2.24.0/lib"
  #DEFINE SLASH "\"
  #DEFINE NL !"\r\n"
  #DEFINE ORDNER "C:\project\"
  #DEFINE EXAMPLE "C:\programs\" & PROJ_NAME & "\bin\" & PROJ_NAME & " "
#ELSEIF DEFINED(__FB_UNIX__)
  #DEFINE SLASH "/"
  #DEFINE NL !"\n"
  #DEFINE ORDNER "~/project/"
  #DEFINE EXAMPLE "/home/user/" & PROJ_NAME & "/" & PROJ_NAME & " "
#ELSE
  #ERROR platform not supported / nicht unterstuetzt!
#ENDIF
and

Code: Select all

FUNCTION codingTobacDef(BYREF W AS STRING, BYREF T AS STRING) AS INTEGER
 var fl = null
  WITH _UI_.Xml
    'VAR fl = STACK_ANZ(.Ref) + LEN(.WiMa)
    fl = STACK_ANZ(.Ref) + LEN(.WiMa)
And when I try to compile:

Code: Select all

pcundall@mint ~/Desktop/GladeToBac3.2/src $ fbc -w all -s gui GladeToBac.bas
/home/pcundall/Desktop/GladeToBac3.2/src/tobac/on_win_main_configure_event.bas(20) warning 3(1): Passing different pointer types, at parameter 2 of GTK_WINDOW_GET_SIZE()
/home/pcundall/Desktop/GladeToBac3.2/src/tobac/on_win_main_configure_event.bas(20) warning 3(1): Passing different pointer types, at parameter 3 of GTK_WINDOW_GET_SIZE()
/home/pcundall/Desktop/GladeToBac3.2/src/GladeToBac_UI.bas(107) warning 3(1): Passing different pointer types, at parameter 2 of GTK_WINDOW_GET_SIZE()
/home/pcundall/Desktop/GladeToBac3.2/src/GladeToBac_UI.bas(107) warning 3(1): Passing different pointer types, at parameter 3 of GTK_WINDOW_GET_SIZE()
/home/pcundall/Desktop/GladeToBac3.2/src/GladeToBac_UI.bas(415) error 57: Type mismatch, at parameter 1 (N) of FIN() in 'Xml.PLiz = Liz.fin(n)'
Same thing! :(
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: GladeToBac compilation problems

Post by MrSwiss »

MrSwiss wrote:Reason: you guys are probably not speaking: "exactly the same language".
hi wumfi,

you (wumfi) are using FBC 64, while (haegar...) is using FBC 32 ... think about it ...
wumfi
Posts: 6
Joined: Apr 25, 2017 9:31

Re: GladeToBac compilation problems

Post by wumfi »

MrSwiss wrote:hi wumfi,

you (wumfi) are using FBC 64, while (haegar...) is using FBC 32 ... think about it ...
Oh! Apologies, I didn't spot that!

The question remains however... Is it possible to compile this under 64 bit Linux? Or is it that Gladetobac was specifically written for the 32 bit version?
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: GladeToBac compilation problems

Post by MrSwiss »

wumfi wrote:Or is it that Gladetobac was specifically written for the 32 bit version?
It's historical (to FBC), in the beginning, there simply wasn't a 64bit version available ...
So, yes, probably needs some re-coding, to become compatible with FBC 64.
wumfi
Posts: 6
Joined: Apr 25, 2017 9:31

Re: GladeToBac compilation problems

Post by wumfi »

Ok. Thank you all for your help in this thread.

Pete
Post Reply