0

I'm trying to build a project using bazel and a C++ STLport library. When I build the program, I get multiple errors such as:

libs/std/type_traits:286:1: error: template with C linkage template <class _Tp> ^

I've looked at other questions that all mention i need to remove the include from an extern "C" {} but there are no extern "C" statements in the code. Any idea?

Fraser
  • 151
  • 1
  • 1
  • 9
  • 2
    You might have an unclosed `extern "C" {` prior to this – Richard Critten Apr 29 '20 at 13:14
  • There are no `extern "C" {}` statements in my code, unfortunately. – Fraser Apr 29 '20 at 13:23
  • What's just before `type_traits:286:1` previous few lines please (line 286 is a funny place to start going wrong in a standard header file). Also check for macro expansions from the build system being substituted in unexpected places. – Richard Critten Apr 29 '20 at 13:38
  • Can you make your compiler output the preprocessed code? You might find more clues there. E.g. g++ -E . https://stackoverflow.com/a/3742831/451600 – Captain Giraffe Apr 29 '20 at 13:38
  • `__CV_SPEC(is_floating_point,float,true); __CV_SPEC(is_floating_point,double,true); __CV_SPEC(is_floating_point,long double,true); template struct is_array : public false_type { }; ` The code falls over multiple times before before that with the same errors but this is what is specifically before this error. – Fraser Apr 29 '20 at 13:52
  • The 1st error is the important one and the few lines before are probably the cause. – Richard Critten Apr 29 '20 at 14:05
  • `template struct integral_constant { static const _Tp value = __v; // enum { value = __v }; ? typedef _Tp value_type; typedef integral_constant<_Tp, __v> type; };` The error that comes with this is: `In file included from libs/std/utility:28:0, from libs/std/stl/_algobase.h:51, from libs/std/algorithm:39, from libs/span.h:6: libs/std/type_traits:38:1: error: template with C linkage template ^ ` – Fraser Apr 29 '20 at 14:09

0 Answers0