I am used to program with Watcom C++ 10.6 under QNX 4, and I am going to
migrating the program to QNX 6 now. But I don’t know how to write the
file “makefile” for my program if the main file includes some other
classe files. The file “makefile” in QNX 4.2 is:
test:test.o sfile1.o sfile2.o sfile3.o
cc -T1 test.o sfile1.o sfile2.o sfile3.o -o test
You will need to replace ‘cc’ with ‘qcc’ and remove the ‘-T1’ option. In you
code you will have to use the “ThreadCtl(_NTO_TCTL_IO, 0)” function to get
IO privity rather then using a compiler option like ‘-T1’. See “ThreadCtl”
in the docs for more information.
One more thing. You do realize that “test” is a poor name for a test
program because it is also a special word to the shell. I.E. if at the
shell prompt you typed:
test
The shell will not execute your program. I do believe you can type:
./test
but I would just choose a different name for my program. I usually
You will need to replace ‘cc’ with ‘qcc’ and remove the ‘-T1’ option. In you
code you will have to use the “ThreadCtl(_NTO_TCTL_IO, 0)” function to get
IO privity rather then using a compiler option like ‘-T1’. See “ThreadCtl”
in the docs for more information.
and type “make myprog” at command line, then iostream.h file can not be
found and the compilation is stoped. With another pogram using socket, I
added -l socket and the socket file can not be found either. Can you
please tell how to fix the missed header file problem? I added -I
/usr/include/g+±3 to find the <iostream.h>, I included too many header
files to put them after -I one by one. They can be found automatilcally
under QNX4. Where are they now?
I am using QNX6.20NC.
Thankx.
Lily
Bill Caroselli wrote:
One more thing. You do realize that “test” is a poor name for a test
program because it is also a special word to the shell. I.E. if at the
shell prompt you typed:
test
The shell will not execute your program. I do believe you can type:
./test
but I would just choose a different name for my program. I usually
use t1, t2 etc.
You will need to replace ‘cc’ with ‘qcc’ and remove the ‘-T1’ option. In you
code you will have to use the “ThreadCtl(_NTO_TCTL_IO, 0)” function to get
IO privity rather then using a compiler option like ‘-T1’. See “ThreadCtl”
in the docs for more information.
and type “make myprog” at command line, then iostream.h file can not be
found and the compilation is stoped. With another pogram using socket, I
added -l socket and the socket file can not be found either. Can you
please tell how to fix the missed header file problem? I added -I
/usr/include/g+±3 to find the <iostream.h>, I included too many header
files to put them after -I one by one. They can be found automatilcally
under QNX4. Where are they now?
I am using QNX6.20NC.
Thankx.
Lily
Two thoughts:
try qcc instead of gcc & g++
what extension are you using for your C++ files?
In all of my makefiles it just somehow knows where to find the C++
include files. I’m doing nothing to tell it where to find them.
and type “make myprog” at command line, then iostream.h file can not be
found and the compilation is stoped. With another pogram using socket, I
added -l socket and the socket file can not be found either. Can you
please tell how to fix the missed header file problem? I added -I
/usr/include/g+±3 to find the <iostream.h>, I included too many header
files to put them after -I one by one. They can be found automatilcally
under QNX4. Where are they now?
I am using QNX6.20NC.
Thankx.
Lily
Two thoughts:
try qcc instead of gcc & g++
what extension are you using for your C++ files?
In all of my makefiles it just somehow knows where to find the C++
include files. I’m doing nothing to tell it where to find them.
Good luck.
My C++ files extension are *.cpp. I tried with QCC and it is OK. But
with gcc, the include library can not be found. Can you please tell me
how to fix it? Thnkx.
In all of my makefiles it just somehow knows where to find the C++
include files. I’m doing nothing to tell it where to find them.
Good luck.
My C++ files extension are *.cpp. I tried with QCC and it is OK. But
with gcc, the include library can not be found. Can you please tell me
how to fix it? Thnkx.
LOL
This is a trick question, right?
Why not just use QCC in your makefile?
My understanding is that QCC sets up a lot of things for you for the
QNX environment. Why not take advantage of it?
If you want I assume that you can pass all of the correct options
to qcc. Just run QCC (which you say works) and look at the line that
it generates. But really, why bother? If in the future QNX changes
things they will undoubtedly give us a new qcc (for a nominal fee).
If you pass all of those options yourself, then you’ll have to change
all of your own makefiles.