This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Having trouble compiling my code on my gaming laptop using ARM compilers 22.0.1

Hi everyone,

I am having trouble compiling my code on my gaming laptop [https://www.lenovo.com/ca/en/d/gaming-laptops/] using ARM compilers 22.0.1 with SVE enabled. The issue seems to be related to the <netdb.h> header file, which is causing a clash during compilation. Has anyone else experienced this issue?

Here's the error message I'm getting:

In file included from /usr/include/netdb.h:28,
from main.cpp:2:
/usr/include/netinet/in.h:96:8: error: redefinition of 'struct in_addr'
96 | struct in_addr {
| ^~~~~~~
In file included from /opt/arm/arm-linux-gnueabi/include/sys/socket.h:38,
from /opt/arm/arm-linux-gnueabi/include/netinet/in.h:24,
from /usr/include/netdb.h:28,
from main.cpp:2:
/opt/arm/arm-linux-gnueabi/include/linux/socket.h:25:8: note: previous definition of 'struct in_addr'
25 | struct in_addr {
| ^~~~~~~
I have tried disabling SVE, which allows the code to compile without any issues, but that's not an ideal solution since I need SVE for my code. I have also tried including the <netinet/in.h> header file before <netdb.h>, but that didn't solve the problem either.

Any help or suggestions would be greatly appreciated. Here's a snippet of the code that's causing the issue:

#include <netdb.h>
#include <arm_sve.h>

int main() {
// Code that uses SVE
return 0;
}

Thanks in advance for your help!

Best regards,
Judy