cross-compilingmuslvsomeip

Compile error with aarch64-linux-musl-cross but not with gcc/g++ (error: ‘string’ in namespace ‘std’ does not name a type)


I'm trying to cross compile vSOMEIP and CommonAPI for ARM with musl (aarch64-linux-musl-cross). I use the following versions:

Further, I'm using a Docker container to compile everything. With "docker buildx build --platform linux/amd64 .." and gcc/g++ every works fine, no compile errors.

However, when I'm using "docker buildx build --platform linux/arm64 .." and gcc/g++ or musl-lib, I get the following compile error:

[  2%] Building CXX object CMakeFiles/vsomeip.dir/implementation/endpoints/src/credentials.cpp.o
In file included from /home/Workspace/lib/vsomeip/implementation/endpoints/src/../include/credentials.hpp:9,
                 from /home/Workspace/lib/vsomeip/implementation/endpoints/src/credentials.cpp:10:
/home/Workspace/lib/vsomeip/interface/vsomeip/primitive_types.hpp:42:14: error: ‘string’ in namespace ‘std’ does not name a type
   42 | typedef std::string trace_channel_t;
      |              ^~~~~~
/home/Workspace/lib/vsomeip/interface/vsomeip/primitive_types.hpp:11:1: note: ‘std::string’ is defined in header ‘<string>’; did you forget to ‘#include <string>’?
   10 | #include <cstdint>
  +++ |+#include <string>
   11 | 

I haven't any idea why the string include or the std namespace creates an error? Can someone help me please. Thanks a lot.

I would like to use the commonAPI/vsomeip COVESA middleware and communication configuration for my system. After long trying the mentioned version above are the ones which are working together.

-- For the full picture, in addition to the mentioned versions above the following components are also needed to implement a full working system of provider and consumer:


Solution

  • Add in

    /home/Workspace/lib/vsomeip/interface/vsomeip/primitive_types.hpp

    #include <string>