Run Programm on an ES with QNX

First, Hello all :slight_smile:

im just new to qnx and want to write some little programms. I’ve downloaded the QNX Momentics 4.7 IDE and got a 30 day licence key.
I made a new QNX c++ Project and add a new target with the ip adress of the Embedded system, where QNX Neutrino 6.5.0 is running.
next i started qconn on the ES and got a connectin(Ethernet) between development system and ES, also i made a new Target in Momemtics to have a connectin. i also can see all processes which are running on the ES.
When i built my “hello World” Project, i got the output in the Momentics Console.
My target is a x86 and in the workspace/Hello_World/x86 folder i have two folders: “o” and “o-g”.

Now my Question ist:
how do i get running the Programm on the ES, that the output is on the ES? and what kind of file should it be?
im a little bit confused about this :confused:

i hope somebody can help me.

PS: sry for my bad english ;)

I may be misunderstanding your question, because it sounds too simple.
You can copy either version of your executable, the one in the o directory or the one in the o-g directory to the ES machine, and then execute it from a shell. For example, if your program is called pgm, you could run it this way:


If you copy it to one of the standard bin directories, eg. /bin /usr/bin or /usr/local/bin then you can execute it with just



thank you for ur reply :slight_smile:

i think its just a little simple problem, but its a problem :smiley:

okay, first of all, now i have a Release Folder in /x86/
in that folder, i have two files : “Hello_World” (this file is without any ending like .exe) and “Hello_World.o”
in my run configurations in the menü “Upload” is “Upload execute to target” set and the folder is: “/tmp/”.
Now when i run the program, i get an output in the Momentics IDE : “Hello World”
but there is no file in “/tmp/” on the target :confused:
an when i want to start my program on the target like “./Hello_World” then i become an error: “/bin/sh: ./Hello_World: cannot execute - No such file or directory”.
do i need an other compiler?

when i build the project i become this messages:

"**** Internal Builder is used for build ****
qcc -o Hello_World.o …\ -V4.4.2,gcc_ntox86_cpp -w -c -O2
qcc -o Hello_World Hello_World.o -V4.4.2,gcc_ntox86_cpp -w1 -lang-c++
Build complete for project Hello_World
Time consumed: 281 ms. "

where is my problem? :frowning:

with best regards :slight_smile:


thank you for ur quick reply :slight_smile:

okay now i have a “Release” folder in /x86 and there are two files “Hello_World” without any ending like .exe and “Hello_World.o”.
in Run Configurations i have set in the menu “Upload” “Upload executable to Target” in the folder “/tmp”.
When i build the project, i get the following output:

**** Internal Builder is used for build ****
qcc -o Hello_World.o …\ -V4.4.2,gcc_ntox86_cpp -w -c -O2
qcc -o Hello_World Hello_World.o -V4.4.2,gcc_ntox86_cpp -w1 -lang-c++
Build complete for project Hello_World
Time consumed: 297 ms.

when i look on the target in the folder “/tmp/”, then there is nothing.
so i cant start the program from the target :confused:
need i upload the file manuell?

where is my problem?
do i need an other compiler?

with best regards :slight_smile:

I’m not that familiar with using Momentics and doing cross compilations, however I do understand the following.

You write your program, and compile it on the Windows or Linux system. The executable does not have .exe (normally) because that’s not the QNX or Unix way. Instead the file gets an executable permission. There is no such thing on Windows, which doesn’t matter. Using Momentics on the WIndows system and qconn on the target, you run your program by dynamically sending it to the target and executing it. Where it goes (/tmp or otherwise) I don’t know. It might be in the /tmp file just long enough to start and run. So when you program exists, it might immediately be deleted.

What you can do with Momentics and qconn however is copy a file from the x86/o directory to somewhere on the targer. I don’t know how exactly but having seen it, I know it’s just like any other Windows copy, dragging from one folder to another.

Once you have the executable copied to QNX, you can run it from a shell. That shell might be on a console at the target, or through a telnet session, or by running phditto on Windows and bringing up a pTerm. How you do might depend on what other software is on your target, but it is up to you to decide. After you copy the executable to the QNX system, you might need to turn on the ‘x’ executable permission on the file. You could do it this way from a shell:

chmod a+x program_name

okay thanks, now i made it ;)
you cant copy the file in the ide by drag and drop.
you need to go to the workspace and then i can use drag and drop to the target :slight_smile:

thank you :slight_smile: