Missing Header File Problem

Hello,

I have recently received some C files from my supervisor and he has asked me to compile them. They were written a few years back on the QNX 4.24 OS and compiled with WATCOM C 10.5. I have tried compiling them again on several compilers (not on QNX 4.24 OS and not with WATCOM C 10.5) with no luck. It will not compile due to the fact that I am missing the following header files:

<sys/proxy.h>
<sys/kernel.h>
<sys/name.h>

Searching for information on these files, it seems as though they are all associated with the QNX 4 OS. I cannot find these files on the QNX Neutrino RTOS v 6.3 and am wondering if there are any equivalents/replacements to these header files that were introduced during the version changes (i.e. are there any current equivalent header files to these files which I assume are outdated).

Thanks,

Michael

There are indeed equivalent in QNX6, however they have been redesigned and renamed. You will have to modify your code or use the porting kit.

check out documentation on Pulses, and name_open.

I’m afraid that this last reply may sound a little optomistic. Since your code uses kernel.h, name.h, and proxy.h, your program is no doubt attaching to or searching for a name, calling message passing routines, and possibly using a proxy.

The functions these provide are all available under QNX 6, however there are significant differences in the implementation. I haven’t looked at the newer QNX 6 name server routines, so they may be close, and they may even cover over the need to create a connection before doing message passing. That will help a lot of so. Proxies don’t exist in QNX 6, although a Pulse should provide the same functionality.

In any case, some careful review of the code will be needed to get it compiled and working.

If the code doesn’t use remote proxy or share proxies between process it can be quite trivial or it can be a nightmare.

Thank you for your responses.

I can see for a fact that there are proxies within the program. I have found that there is a Migration Library that one can download on the QNX website. From reading about it, my impression is that all I need to do to get the QNX 4 code running on QNX 6 is to include “#include <mig4nto.h>” at the top of the C file, to include the “mig4nto_init();” function at the beginning of the main function, and to run the migration process manager (mig4nto-procmgr) when I am ready run the compiled code.

However, a new problem arises in the fact that I am missing <conio.h> and <i86.h>. I was aware of this when I wrote my initial post, but I had assumed that I could just copy these header files from Open Watcom (from Windows XP) and place them into the appropriate directory in QNX 6. I now know that this won’t work as I need to also transfer the associated libraries. Open Watcom does not seem to support QNX, as WATCOM once did, therefore, I cannot even get these associated libraries into QNX 6. I think I only have two options now: either rewrite the code myself (I only have one semester of C++ behind my belt, but I’m pretty sure I could figure everything out given enough time) or I can purchase Watcom C 10.6 for the low price of $845 to get these libraries for QNX 6. If any of you can see any other possible avenues please let me know.

Thanks

Michael

It is very unlikely that using the Watcom 10.6 libraries under QNX 6 will work. For one thing, the Watcom calling convention is non standard. Watcom optomized the code by passing parameters in registers when possible. This is different from the usual C standard of passing parameters on the stack.

I think your only option is to review the code, substituting routine calls when needed.

Buying Watcom C won’t give you access to the source to the library. Even it did , the library could well endup calling QNX4 specific fonction so you’be be back to square one.

The migration library makes it sound a little too easy… But it’s definitely a good choice. The problem is that if the code is doing something the library doesn’t support it can get messy.

If your supervisour gave you this task and you’ve only got one semester of C/C++ then that supervisor got some supervising to do ;-0