Common Mistakes


This section lists some common mistakes that occur when adding USS support to classes. The compile and link-time errors received depend on the compiler used. The errors reported by one particular compiler are presented here. For brevity, the code examples are not presented here, but they are provided in the directory <ospace/stream/examples>.


os_streaming_toolkit_error: duplicate class
        Class with ID 1001 defined for both Y and X
Check rtti/binary stream macros.

Wrote to the stream :
1  2
Caught os_streaming_toolkit_error:
        Attempt to read wrong type.
        type_mismatch: Cannot cast from Y to X,
            check rtti/binary stream macro.

Undefined                       first referenced
 symbol                             in file
os_class_of_aux(X*)            mistake3.o
ld: fatal: Symbol referencing errors. No output written to mistake3
*** Error code 1
make: Fatal error: Command failed for target `mistake3'
Exit 1

Wrote to the stream :
1
Caught stream error:
      Incorrect or no RTTI/Binary Stream macro is supplied for class.
      uninitialized_class: Allocate/Deallocate functions not
      available for class X, check rtti/binary stream macro.

Refer to the "Add a Macro to a Source File" section of this chapter for use limitations of concrete classes without public default constructors.


"../../../ospace/rtti/regmacro.h", line 112: Error: Cannot create a variable for abstract class X.
1 Error(s) detected.
*** Error code 1
make: Fatal error: Command failed for target `mistake5.o'
Exit 1

mistake6.cpp", line 54: Error: The operation "os_bstream << X" is illegal.
1 Error(s) detected.
*** Error code 1
make: Fatal error: Command failed for target `mistake6.o'
Exit 1

Wrote to the stream :
1  A
Caught stream error:
        Attempt to read wrong type.
        type_mismatch: Tried to read char but got int

Wrote to the stream :
1  A
Caught stream error:
        An object was not written in the same way it was read.
        framing_error: Tried to read char but got end of object

Copyright©1994-2026 Recursion Software LLC
All Rights Reserved - For use by licensed users only.