Home
Developer Resources
QNX RTOS v4
QNX RTOS v4 Knowledge Base

QNX RTOS v4 Knowledge Base

Foundry27
Foundry27
QNX RTOS v4 project
Resources

QNX RTOS v4 Knowledge Base

Title Problems with C++ return type (double.float)
Ref. No. QNX.000009473
Category(ies) Development
Issue We are using QNX4, and the Watcom 10.6 C++ compiler.

There is a question about the member function of a class.

When the member function of a class is declared with a return type(double,float), the code in that function does not get executed.

But if the member function is declared with a  return type (int, bool), it works as expected.

How can we deal with this problem?
Solution We assume that you are running on a computer that has a floating point unit built in, and does not need the emu87 floating point emulator running.

Normally, the compiler will automatically take care of the floating point settings.

You should compile your program with the floating point option (fp2, fp3, fp5, or fpi). All modules in the code must be compiled with the same floating point option. If not you will get compiler errors.

If you are getting the error:

'__init_387_emulator is an undefined reference', it means that only part of your program was compiled with one of the floating point arguments.