PowerBASIC exes won't run

Questions about Wine on Linux
Locked
algojack
Level 1
Level 1
Posts: 6
Joined: Wed Aug 11, 2021 6:19 am

PowerBASIC exes won't run

Post by algojack »

I'm using Wine 6.01 on Linux mint 20.2 (64bit).

PowerBASIC is a 32bit application, and I'd heard reports that it runs well on Wine. However, although it installs fine and the IDE runs well and compiles sources, when I try to run the generated exes I get an error from the IDE : "Bad EXE", and when trying to execute them from the terminal I get "not supported on this system".

The error messages are the kind you get when trying to run a 64bit app on a 32bit system, or vice-versa. I installed a copy of PB on Windows 7 in VirtualBox, and no problems there, and the exes produced on W7 also run fine using Wine.

Just to be sure, I also installed PB on my netbook which runs 32bit Linux (Q4OS), and got the same error message.
algojack
Level 1
Level 1
Posts: 6
Joined: Wed Aug 11, 2021 6:19 am

Re: PowerBASIC exes won't run

Post by algojack »

If it helps, I can provide "hello world" exes generated by PB on Wine and Windows 7. I don't know much about low-level stuff, but perhaps someone here may be able to analyse them for differences which may provide a clue to what's going on?

p.s. I'm away for a couple of days and won't be able to respond until Saturday.
jkfloris
Level 12
Level 12
Posts: 3201
Joined: Thu Aug 14, 2014 10:10 am

Re: PowerBASIC exes won't run

Post by jkfloris »

If it helps, I can provide "hello world" exes
A simple sample program would be helpful.
algojack
Level 1
Level 1
Posts: 6
Joined: Wed Aug 11, 2021 6:19 am

Re: PowerBASIC exes won't run

Post by algojack »

Thanks for the reply. Here is the hello world program which you can find in the samples folder :

Code: Select all

'-------------------------------------------------------------------------------
'
'  HELLO.BAS example for PowerBASIC for Windows
'  Copyright (c) 1996-2021 PowerBASIC Tools, LLC
'  All Rights Reserved.
'
'-------------------------------------------------------------------------------

#COMPILER PBWIN 10
#COMPILE EXE

' The resource gives the EXE program the "hello" icon in Explorer,
' and provides it with Windows version information.
#RESOURCE ICON, 100, "Hello.ico"
#RESOURCE VERSIONINFO
#RESOURCE FILEVERSION 10, 0, 0, 0
#RESOURCE PRODUCTVERSION 10, 0, 0, 0
#RESOURCE STRINGINFO "0409", "04B0"
#RESOURCE VERSION$ "Comments",         "Hello, World Example"
#RESOURCE VERSION$ "CompanyName",      "PowerBASIC Tools, LLC"
#RESOURCE VERSION$ "FileDescription",  "Simple MSGBOX Application for Windows"
#RESOURCE VERSION$ "FileVersion",      "10.0"
#RESOURCE VERSION$ "InternalName",     "Hello"
#RESOURCE VERSION$ "LegalCopyright",   "Copyright © 1996-2021 PowerBASIC Tools, LLC"
#RESOURCE VERSION$ "LegalTrademarks",  "PowerBASIC ®"
#RESOURCE VERSION$ "OriginalFilename", "HELLO.EXE"
#RESOURCE VERSION$ "ProductName",      "PowerBASIC Compiler for Windows"
#RESOURCE VERSION$ "ProductVersion",   "10.0"
'
FUNCTION PBMAIN () AS LONG

    MSGBOX "Hello, World!"

END FUNCTION
You don't actually need all those #RESOURCE lines, just #COMPILE EXE and the function PBMAIN. Here is the output from the IDE when I try to compile and run.

Image

Thanks in advance for any help.
jkfloris
Level 12
Level 12
Posts: 3201
Joined: Thu Aug 14, 2014 10:10 am

Re: PowerBASIC exes won't run

Post by jkfloris »

If I compile the script without the #RESOURCE lines, it does seem to work.

Code: Select all

#COMPILER PBWIN 10
#COMPILE EXE

FUNCTION PBMAIN () AS LONG

    MSGBOX "Hello, World!"

END FUNCTION
Soon I will take a look at why the #RESOURCE lines don't work.
algojack
Level 1
Level 1
Posts: 6
Joined: Wed Aug 11, 2021 6:19 am

Re: PowerBASIC exes won't run

Post by algojack »

Yes, I tried several other programs in the sample folder and they all run after removing the #RESOURCE lines. Apparently this statement is new to version 10, so perhaps all reports I've seen regarding running PB on Wine have been from those using prior versions where the resources had to be compiled manually. I think this can still be done using version 10.
User avatar
DarkShadow44
Level 9
Level 9
Posts: 1338
Joined: Tue Nov 22, 2016 5:39 pm

Re: PowerBASIC exes won't run

Post by DarkShadow44 »

So, the exes compiled on Wine don't run under Wine, but under Windows?
What if the exes are compiled under windows, do those run under Wine?

I'd test, but it's a paid program. Or is there a free demo/version?
algojack
Level 1
Level 1
Posts: 6
Joined: Wed Aug 11, 2021 6:19 am

Re: PowerBASIC exes won't run

Post by algojack »

No, the exes compiled on Wine don't run on Windows (I get the same error message), but they do run in Wine if they are compiled on Windows. There isn't a trial version, but is it possible to send private messages?
User avatar
DarkShadow44
Level 9
Level 9
Posts: 1338
Joined: Tue Nov 22, 2016 5:39 pm

Re: PowerBASIC exes won't run

Post by DarkShadow44 »

algojack wrote: Fri Aug 27, 2021 9:46 am No, the exes compiled on Wine don't run on Windows (I get the same error message), but they do run in Wine if they are compiled on Windows.
Interesting, so the executables themselves are broken when made with Wine. Good to know, but probably more annoying to find out.

I don't know about private messages, although I can be contacted via email. Can you please open a bugreport on bugs.winehq.org?
MarkNEW
Newbie
Newbie
Posts: 2
Joined: Sat Aug 28, 2021 9:11 am

Re: PowerBASIC exes won't run

Post by MarkNEW »

Hello,

I am actually using PB 9 ..and yes ..can report, that it runs on ReactOS ...which probably is an indicator, that it also runs on Wine
algojack
Level 1
Level 1
Posts: 6
Joined: Wed Aug 11, 2021 6:19 am

Re: PowerBASIC exes won't run

Post by algojack »

I don't know about private messages, although I can be contacted via email. Can you please open a bugreport on bugs.winehq.org?
Ok, I will open a bug report. Could you let me know your email address?
User avatar
DarkShadow44
Level 9
Level 9
Posts: 1338
Joined: Tue Nov 22, 2016 5:39 pm

Re: PowerBASIC exes won't run

Post by DarkShadow44 »

I don't want to post it publicly, but I'll add myself to the bugreport and as registered user you can see it :)
Locked