Just installed Ubuntu 6.1 and has some "dumb" ques

For everything that's not in any way related to PureBasic. General chat etc...
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post 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...
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post 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)
quidquid Latine dictum sit altum videtur
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Couldn't you run "/bin/sh" with all the commands you want executed as the parameter (similar to cmd's /c switch)?
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post 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:
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
User avatar
GeoTrail
Addict
Addict
Posts: 2794
Joined: Fri Feb 13, 2004 12:45 am
Location: Bergen, Norway
Contact:

Post 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 ;)
I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
Baldrick
Addict
Addict
Posts: 860
Joined: Fri Jul 02, 2004 6:49 pm
Location: Australia

Post 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?
Nik
Addict
Addict
Posts: 1017
Joined: Fri May 13, 2005 11:45 pm
Location: Germany
Contact:

Post 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
Thalius
Enthusiast
Enthusiast
Posts: 711
Joined: Thu Jul 17, 2003 4:15 pm
Contact:

Post 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
"In 3D there is never enough Time to do Things right,
but there's always enough Time to make them *look* right."
"psssst! i steal signatures... don't tell anyone! ;)"
Baldrick
Addict
Addict
Posts: 860
Joined: Fri Jul 02, 2004 6:49 pm
Location: Australia

Post 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.
Post Reply