Page 3 of 3

Posted: Sun Dec 24, 2006 3:12 pm
by Psychophanta
Ops, i've read about RunProgram() linux function was not able to do somethings and that it is in the 'todo' list or something like that...

Posted: Sun Dec 24, 2006 3:57 pm
by freak
> Ops, i've read about RunProgram() linux function was not able to do somethings and that it is in the 'todo' list or something like that...

No. There is nothing on the list for RunProgram(). It should work like on windows.

"export" is not a program anyway, but a shell command as well. So it only works in a shell.
Also, changing environment variables only affects the current program + later started
child programs. So even if this worked, the variable change does not affect
the own program (only the child), so also not the later RunProgram() for the IDE.

PB has commands to modify environment variables. The changes are passed
on when a new program is run as a child. so try this:

Code: Select all

SetEnvironmentVariable("PUREBASIC_HOME", GetEnvironmentVariable("HOME") + "/purebasic")
SetEnvironmentVariable("PATH", GetEnvironmentVariable("PATH") + ":" + GetEnvironmentVariable("HOME") + "/purebasic/compilers")
RunProgram("purebasic", Parameter.s, WorkingDirectory.s)

Posted: Sun Dec 24, 2006 4:03 pm
by Trond
Couldn't you run "/bin/sh" with all the commands you want executed as the parameter (similar to cmd's /c switch)?

Posted: Mon Dec 25, 2006 10:34 am
by Psychophanta
That's great, thank you Timo :D
Trond wrote:Couldn't you run "/bin/sh" with all the commands you want executed as the parameter (similar to cmd's /c switch)?
Yes, in linux you can make any .sh (bash) file in which you accept any number of parameters. Inside the file, the parameters are obtained with: '$1', '$2', '$3', etc. the name of the bash file would be obtained with '$0' :wink:

Posted: Mon Dec 25, 2006 4:36 pm
by GeoTrail
I didn't know that. But then again, there's allot I don't know about Linux ;)
Oh, btw, I'm still running Ubuntu. Longest ever I have had Linux running on my machine ;)

Posted: Wed Apr 25, 2007 11:41 am
by Baldrick
Thought I would use this thread for my dumb question rather than start a new dumb questions thread. :)
I have just installed the latest stable release of Debain Sarge onto my test machine & me being a Linux illiterate I must say it was surprisingly easy to do.

I now have PB4 Linux working with some help from this thread, so thanks to the ppl who have thrown their dollars worth in so far.

My question is regards to InitSound() function in this Linux version which is for some reason failing on me. - An example of this is the WeaponzII sample in the example files which simply returns 0 on this machine, but all the graphics work seamlessly. Is there maybe something else I need to install for PB to have sound functions work?

Also. fwiw - Sound is working fine with gnome default sounds, mp3's, wav, etc, just not in the PB environment?

Posted: Wed Apr 25, 2007 12:23 pm
by Nik
Can't help you with IniTSound but wanted to mention that as of a few weeks ago the newest stable debian is Etch not Sarge

Posted: Wed Apr 25, 2007 12:47 pm
by Thalius
Yup 7.04 Ubuntu has some nice little tweaks.
http://www.ubuntu.com/getubuntu/upgrading

@baldrick:
Getting any error when you compile in console ?

Thalius

Posted: Wed Apr 25, 2007 1:21 pm
by Baldrick
@Thalias,
I just tried the console from your suggestion & yes I am getting an error
ALSA lib pcm_dmix.c:864:(snd_pcm_dmix_open) unable to open slave
Since my original post here I have changed the libsdl from 1 option to another option debian has called "all". This has stopped the 0 return on initsound(), but now this same example crashes when an attempt is made to play a sound.