Linker error for overloaded typecast into string in class

  abi, c++, cross-compiling, linker-errors, string

it seems I am having a linking problem. In my project im using a class that is defined in a header file, whose methods´ definitions lie in a precompiled library. I am using CMake and the compiling command includes the path to the precompiled library set correctly by the -L compiler flag.

The linking problem relates to an overloaded typecast. In the header file, the overloaded typecaset looks like this:

namespace comm {

   struct InstanceID{
       .
       .
      __attribute__ ((visibility("default"))) operator ipl::string () const;
  }
}

and as mentioned, the definition lies in a precompiled library. I peeked inside the precompiled library using the nm linux took and the reference is indeed defined there:

enter image description here

Note that in C string is a typecast of std:basic_string<char, traits, allocator>

The linking error that I get looks like this:
enter image description here

You can note that the definition in the precompiled library includes >[abi::cx11], whilst the reference shown in the error does not.

Maybe this is the error, that the reference is not exactly the same? How could I solve this? What else could it be?

Thank you!

Source: Windows Questions C++

LEAVE A COMMENT