Problems passing options to the shell compiler...

Linux specific forum
DeeCee
User
User
Posts: 34
Joined: Wed Dec 31, 2003 11:14 pm

Problems passing options to the shell compiler...

Post by DeeCee »

I'm not sure if this is a bug or a case of "newbie-ness", but I cannot seem to get the shell compiler to accept any arguments.

Example 1:
According to the doc's, the /? should present a list of options. Instead, I get:
$ pbcompiler /?
******************************************
PureBasic Linux x86 v3.81
******************************************
The file '/?' isn't found or can't be opened !



Example 2:
Compiling while using the /EXE "filename" option is supposed to create an executable using the name specified. Here are the results copied diectly from the shell:

$ pbcompiler /EXE "test" Example.pb
******************************************
PureBasic Linux x86 v3.81
******************************************
Loading external modules...
Starting compilation...
33 lines processed.
Creating the executable.

- Feel the ..PuRe.. Power -

**Note- In this case the executables *are* being generated, but always as "purebasic.exe" instead of the name specified.

Any ideas or tips?

-DeeCee-
robink
User
User
Posts: 26
Joined: Sat Jan 03, 2004 7:25 pm
Location: Rinteln
Contact:

Post by robink »

pbcompiler -h
lists alls options and you can create an executable with:
pbcompiler -e filename filename.pb
Christian
Enthusiast
Enthusiast
Posts: 154
Joined: Mon Dec 08, 2003 7:50 pm
Location: Germany

Post by Christian »

Hi!

This should really be included in the help. I've also searched for this. :?

But why does the Debugger (pbcompiler -d code.pb) does not work? I've tried to compile a easy ...

Code: Select all

a.l = 500
Debug a
... but it didn't work.

best regards,
Christian
robink
User
User
Posts: 26
Joined: Sat Jan 03, 2004 7:25 pm
Location: Rinteln
Contact:

Post by robink »

Ok i tried to compile that too, and i get an error message:

Code: Select all

******************************************
PureBasic Linux x86 v3.81
******************************************
                                                                                
Loading external modules...
Starting compilation...
3 lines processed.
Creating the executable.
gcc: purebasic.o: No such file or directory
                                                                                
- Feel the ..PuRe.. Power -
                                                                                
robin@robin:~/purebasic$ sh: line 1: ./purebasic.exe: No such file or directory
Saboteur
Enthusiast
Enthusiast
Posts: 272
Joined: Fri Apr 25, 2003 7:09 pm
Location: (Madrid) Spain
Contact:

Post by Saboteur »

robink wrote:Ok i tried to compile that too, and i get an error message:

Code: Select all

******************************************
PureBasic Linux x86 v3.81
******************************************
                                                                                
Loading external modules...
Starting compilation...
3 lines processed.
Creating the executable.
gcc: purebasic.o: No such file or directory
                                                                                
- Feel the ..PuRe.. Power -
                                                                                
robin@robin:~/purebasic$ sh: line 1: ./purebasic.exe: No such file or directory
I get this error when I try to compile a program that access to Linux API :(
[:: PB Registered ::]

Win10 Intel core i5-3330 8GB RAM Nvidia GTX 1050Ti
Christian
Enthusiast
Enthusiast
Posts: 154
Joined: Mon Dec 08, 2003 7:50 pm
Location: Germany

Post by Christian »

@robink:
Exactly the same like me! Strange ...

This is also a strange thing: Every time compiling a code, this 'purebasic.exe' is compiled.

@Saboteur:
Which Linux API commands? GTK, SDL or other? Perhaps you have some example?

best regards,
Christian
robink
User
User
Posts: 26
Joined: Sat Jan 03, 2004 7:25 pm
Location: Rinteln
Contact:

Post by robink »

The purebasic.exe is your compiled program, you can change the outputfile with -e filename.
Saboteur
Enthusiast
Enthusiast
Posts: 272
Joined: Fri Apr 25, 2003 7:09 pm
Location: (Madrid) Spain
Contact:

Post by Saboteur »

I tried to compile the example: linux_api.pb (in examples/sources), but with no exit.
[:: PB Registered ::]

Win10 Intel core i5-3330 8GB RAM Nvidia GTX 1050Ti
TronDoc
Enthusiast
Enthusiast
Posts: 310
Joined: Wed Apr 30, 2003 3:50 am
Location: 3DoorsDown

Post by TronDoc »

I have something different on RedHat 9..
..I can compile fine, but cannot execute from the terminal window.
If I use the file browser and double click, then the program runs.

..a simple console app I cannot get the executable to run either
from the terminal window nor the file browser; however,
if I just pbcompiler filename.pb
it runs from the terminal window and outputs there..
..I think I saw something about that in another posting; so please
excuse another (Linux) newbie...
Joe
peace
[pI 166Mhz 32Mb w95]
[pII 350Mhz 256Mb atir3RagePro WinDoze '98 FE & 2k]
[Athlon 1.3Ghz 160Mb XPHome & RedHat9]
Saboteur
Enthusiast
Enthusiast
Posts: 272
Joined: Fri Apr 25, 2003 7:09 pm
Location: (Madrid) Spain
Contact:

Post by Saboteur »

The exactly message I get with linux_api.pb is:

Code: Select all

******************************************
PureBasic Linux x86 v3.81
******************************************

Loading external modules...
Starting compilation...
24 lines processed.
Creating the executable.
gcc: c: No such file or directory

- Feel the ..PuRe.. Power -
8O
[:: PB Registered ::]

Win10 Intel core i5-3330 8GB RAM Nvidia GTX 1050Ti
Christian
Enthusiast
Enthusiast
Posts: 154
Joined: Mon Dec 08, 2003 7:50 pm
Location: Germany

Post by Christian »

@RobinK:
This seems to be logical. :) But why is this file an exe-file? I think this is windows specific?

@TronDoc:
I'm not sure, but the help says that the console functions just run under windows.

@Saboteur:
OK ... know it becomes scary. Have the same problem now, too. But I know exactly that the linux_API.pb example worked fine, some days ago. So there is a problem with the libgcc ...

Tried to include the gcc-library in the code and it worked then:

Code: Select all

lib.l = OpenLibrary(1, "/lib/libgcc_s.so.1")

*Buffer = CallFunction(1, "malloc", "10000")
If *Buffer
  MessageRequester("PureBasic", "Memory allocated", 0)

  ; Free the memory block by calling 'free'

  CallFunction(1, "free", Buffer)
EndIf
CloseLibrary(1)

End
I don't know what distro you have, but I hope the lib is on the same place like mine. If not, try to find it on your system.

So purebasic have a problem to find the lib. Don't know why ... (perhaps Fred has an idea?) ... nevertheless it's strange that it worked first without including the lib directly.

regards,
Christian

PS: Perhaps anybody else tries the linux_API.pb example?
robink
User
User
Posts: 26
Joined: Sat Jan 03, 2004 7:25 pm
Location: Rinteln
Contact:

Post by robink »

Some of the console functions are working under Linux and i can execute console applications
from the terminal but not from the filemanager.
I've got the same problem with the linux_api.pb and Christian's code works on my pc.
TronDoc
Enthusiast
Enthusiast
Posts: 310
Joined: Wed Apr 30, 2003 3:50 am
Location: 3DoorsDown

Post by TronDoc »

Christian wrote:PS: Perhaps anybody else tries the linux_API.pb example?

Code: Select all

[trondoc@TronDoc samples]$ pbcompiler linux_api.pb -e linux_api.bin
 ******************************************
PureBasic Linux x86 v3.81
******************************************
 
Loading external modules...
Starting compilation...
24 lines processed.
Creating the executable.
gcc: c: No such file or directory
 
- Feel the ..PuRe.. Power -
 
[trondoc@TronDoc samples]$
looks like it doesn't work here either! :?
peace
[pI 166Mhz 32Mb w95]
[pII 350Mhz 256Mb atir3RagePro WinDoze '98 FE & 2k]
[Athlon 1.3Ghz 160Mb XPHome & RedHat9]
Christian
Enthusiast
Enthusiast
Posts: 154
Joined: Mon Dec 08, 2003 7:50 pm
Location: Germany

Post by Christian »

Seems really to be a bug. I'll send a PN to Fred.

best regards,
Christian
pbdep
User
User
Posts: 68
Joined: Fri Apr 25, 2003 5:18 pm
Location: Netherlands

Post by pbdep »

I dont see the problem? Works fine here...
pbdep.
Post Reply