diff --git a/compiler2/union.c b/compiler2/union.c
index 831af099abf18bdd3bd49eda075f191e832c6397..95350af71a3e1ddf5179c6b8e9dfea1c9b65b9d8 100644
--- a/compiler2/union.c
+++ b/compiler2/union.c
@@ -2409,6 +2409,12 @@ void defUnionClass(struct_def const *sdef, output_struct *output)
       def = mputstr(def,
         "int OER_encode_negtest(const Erroneous_descriptor_t*, "
         "const TTCN_Typedescriptor_t&, TTCN_Buffer&) const;\n");
+      src = mputprintf(src,
+        "int %s::OER_encode_negtest(const Erroneous_descriptor_t*, "
+        "const TTCN_Typedescriptor_t&, TTCN_Buffer&) const {\n"
+        "  return 0;\n"
+        "}\n"
+        , name);
      //todo
     }
     // OER decode