Umberto Cancedda
|
Conflicts with previous declarations due to #include_next
|
Umberto Cancedda
04/26/2024 11:16 AM
post122522
|
Conflicts with previous declarations due to #include_next
Dear community,
I'm working on a QNX 7.1 based project and I'm facing compile errors regarding conflicting declarations. This is somehow
related to #include_next statements. From the code I see, that there are a lot of compiler switches controlling the
includes but I really cannot figure out which one to set or unset. In my special case it is about the function "long
long int std::abs(long long int)" which conflicts with "long long int abs(long long int)". It definitely has to do with
stdlib.h and cstdlib.
To be more precise, here is a piece of the build log showing the error:
n file included from /home/developer/qnx710/target/qnx7/usr/include/c++/8.3.0/cstdlib:77,
from /home/developer/qnx710/target/qnx7/usr/include/c++/8.3.0/bits/stl_algo.h:59,
from /home/developer/qnx710/target/qnx7/usr/include/c++/8.3.0/algorithm:62,
from /home/developer/vrte/project/mcgateway/mcgateway/common/common_std_inc.hpp:52,
from /home/developer/vrte/project/mcgateway/mcgateway/common/common_inc.hpp:50,
from /home/developer/vrte/project/mcgateway/mcgateway/common/xcp_adaptive_service_params.cpp:48:
/home/developer/qnx710/target/qnx7/usr/include/c++/8.3.0/bits/std_abs.h:56:15: error: 'long int std::abs(long int)'
conflicts with a previous declaration
abs(long __i) { return __builtin_labs(__i); }
^
In file included from /home/developer/qnx710/target/qnx7/usr/include/c++/8.3.0/cstdlib:75,
from /home/developer/qnx710/target/qnx7/usr/include/c++/8.3.0/bits/stl_algo.h:59,
from /home/developer/qnx710/target/qnx7/usr/include/c++/8.3.0/algorithm:62,
from /home/developer/vrte/project/mcgateway/mcgateway/common/common_std_inc.hpp:52,
from /home/developer/vrte/project/mcgateway/mcgateway/common/common_inc.hpp:50,
from /home/developer/vrte/project/mcgateway/mcgateway/common/xcp_adaptive_service_params.cpp:48:
/home/developer/qnx710/target/qnx7/usr/include/c++/v1/stdlib.h:111:44: note: previous declaration 'long int abs(long
int)'
inline _LIBCPP_INLINE_VISIBILITY long abs(long __x) _NOEXCEPT {return labs(__x);}
I'd be grateful for any hint on how to solve these conflicts.
Best regards
Cheers
Umberto
|
|
|