several newbie questions

I’m am really excited about the QNX environment and would like to get in sync with it. However I’m too used to windows and working with IDE’s. Quite glad you guys and gals are around because I need to know a few things.

-First attempt with GCC compiler, how do I compile a set of files that I had preciously saved into a Project workspace like MSVC.(what commands do I use):?:

  • I’ve heard it said that I bo not really need to change mush in my code to get it to run on QNX ture/false are tehre any #defines extra code lines flags etc I may need to alter?:?:
    -if I have a previously compiled command line running program that needs to exacute through a batch file how do I call it?(get it to run)
    -where can I find useful tutorialon this?:?:

p.s I do not want to use the IDE on QNX (I’m using vs 6.1) because it keeps crashing on me.

thanks for all your help :stuck_out_tongue:

The easiest way to compile C with gcc is basically gcc myfile.c -o myexec, but if you’ve used any Windows specific functions, it’s not going to work. Whether you need to change much to compile on QNX depends what you’ve done, if it’s just ANSI C then you’ll probably be fine.

To run stuff in a batch file (or shell script, in UNIX land ;-)) make a text file, save it with the first line as


and the second line as the full path of your program to run. On the terminal, do ‘chmod +x’, and now you can run your shell script by calling it like any othe program on the terminal. If it complains about ‘bad interpreter’ or something, try #!/bin/sh instead.

You should try 6.2.1 I use the IDE on that and it’s solid as a rock.



It depends what the code is. If it’s POSIX or ANSI C, should be trival. If it’s windows code, its going to be a nightmare

If you have the IDE you have the PE version, which means you should talk to QSS to get it fix (and it is probably fixed in later version), at $8000 you are entitled to that!!! QSS needs your help to fix/discover problem.

Well, if he has 6.1 he doesn’t have the IDE since we didn’t have an IDE until 6.2.0. So I presume he means Eclipse from

you are right cdm I am actually using 6.2 sorry about the misprint.
thanks for your help Garry
I got the shellsccript running but imy executables functions aren’t working .
I’m actually trying to run Lame but it doesn’t seem to recognise the lame commands when I type them into the terminal

and Mario it is actually ANSI C but i’ll hola if i have any trouble thanks

Kui, if you post your shell script, and the error message you get, might be able to help.

Hi Gary,
the shelling is done fine its the lame commands that should run after the lame.exe is shelled that don’t run.

chmod +x
lame testcase.wav testcase.mp3
/bin/sh: lame not found

I thought it was due to files being in different directories so I transfeered all files to the same directory but this same error is given

Kui, sounds like the directory which contains lame is not in your $PATH variable, so you can either put the directory which contains lame into $PATH, or you can state the full path to lame like this:

/usr/local/bin/lame testcase.wav testcase.mp3

If the directory which contains lame is the current directory, then you can also do

./lame testcase.wav testcase.mp3

Also, if you’re using sh as your normal shell, you should consider using bash, this can autocomplete filenames when you enter the first few characters and press tab, and makes entry of stuff like this into the terminal much easier.

Hope that helps, if it still gives errors, post them, I have lame working here so any problems you’re having I’ve probably had myself!


ksh can autocomplete by pressing ESC twice.

hey gary thanks
I really can’t expalin this because I’ve made sure all the files I’m using are in the same directory and I’m checking what directory is in use and its the one with all the fies in so I’m guessing maybe my problem is how I got lame onto QNX in the first place.

Glad you are running lame as well maybe you can spot any errors on my part.

I downloaded the files off the net
lame 3.95.1
compiled it on MSVC and created the lame.exe file
tested it on windows it worked pretty fine
copied the files onto disc and tranferred the to QNX non-professional momentics
and thats when I started my wailing because it wouldn’trun

I also downloaded the procompiled lame 3.91 off
thought maybe it was my compilation that was wrong
but it won’t run either.

should i recompile the whole thing on QNX?
if so how do I get all the project code compiled and linked under the gcc. I was avoiding this because of the problems mentioned earlier.

Mario thanks for your suggestion with the bash thingy I tried that but my problem persists :open_mouth:
but thanks its nice I can find help here :smiley:

Hi Kui,
Unless you’ve got some fancy version of MSVC I’ve never heard of, it can only make Windows executables, not those that work on QNX.

The pre-compiled one should work fine, but I went from source with this:

So, if you download that and…

tar -zxvf lame-3.93.1.tar.gz

that’ll give a directory called lame-3.92.1, cd into that, and become root using the ‘su’ command, and enter your root password.
make install

some of these stages will take a while, depending on how fast a machine you’ve got, but at the end of it you’ll be able to open up a terminal and ‘lame’, if it says ‘lame not found’ type ‘/usr/local/bin/lame’. and add /usr/local/bin to $PATH ASAP ;-)



hey Gary

I’m toatlly cracking up about this.

Well I’ve made my newbie maginanimous error and I will blush every time I think of it in my later QNX life but hey will try out the link you gave me and tell you how it went. I have to leave the lab now though. Talk to you tommorow.

Hey that worked like a charm. Now all I have to do is fugure out just how Lame works bacause I have to explain it to loads of people. You are absolutely gorgeous thanks for all your help. :smiley:

Er, thank you… :slight_smile:

Something I forgot to mention before, if you’re using bash as your terminal, in your home directory, there is a file called .bashrc, you can add all your $PATH commands to that, save entering them over and over.