Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make error: tcpkali_syslimits.c:34:10: fatal error: sys/sysctl.h: No such file or directory #75

Open
hgkiller opened this issue May 25, 2022 · 5 comments · May be fixed by #77
Open

make error: tcpkali_syslimits.c:34:10: fatal error: sys/sysctl.h: No such file or directory #75

hgkiller opened this issue May 25, 2022 · 5 comments · May be fixed by #77

Comments

@hgkiller
Copy link

tcpkali_syslimits.o -MD -MP -MF .deps/tcpkali-tcpkali_syslimits.Tpo -c -o tcpkali-tcpkali_syslimits.o test -f 'tcpkali_syslimits.c' || echo './'tcpkali_syslimits.c
tcpkali_syslimits.c:34:10: fatal error: sys/sysctl.h: No such file or directory
34 | #include <sys/sysctl.h>
| ^~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [Makefile:627: tcpkali-tcpkali_syslimits.o] Error 1

@raymondtay
Copy link

There are a couple of ways to resolve this and its dependent on the OS you are using.
Here is what I did using the Ubuntu 22.04 image from AWS is to install the linux header files and creating the appropriate links s.t. the C preprocessor can locate them, here're the details:

  • Install the headers sudo apt install -y linux-headers-$(uname -r); header files will be at /usr/include/linux.
  • The default includes is /usr/local/include and you can create the symbolic links for the various <sys/xxx.h> files by linking the headers from the first step over into this folder.

@qiujiafei
Copy link

There are a couple of ways to resolve this and its dependent on the OS you are using. Here is what I did using the Ubuntu 22.04 image from AWS is to install the linux header files and creating the appropriate links s.t. the C preprocessor can locate them, here're the details:

  • Install the headers sudo apt install -y linux-headers-$(uname -r); header files will be at /usr/include/linux.
  • The default includes is /usr/local/include and you can create the symbolic links for the various <sys/xxx.h> files by linking the headers from the first step over into this folder.

Please how to create symbolic links various <sys/xxx.h>, this is my command

ln -s /usr/local/include  /usr/include/linux

but I have same error

tcpkali_syslimits.c:34:10: fatal error: sys/sysctl.h: No such file or directory

@blalockma
Copy link

@gaffeyQiu First create the folder sys if it doesn't exist then individually link the sysctl.h file:

sudo mkdir /usr/local/include/sys
sudo ln -s /usr/include/linux/sysctl.h /usr/local/include/sys/sysctl.h

Worked for me.
Thanks for the tip @raymondtay!

@qiujiafei
Copy link

usr/include/linux/sysc

@gaffeyQiu First create the folder sys if it doesn't exist then individually link the sysctl.h file:

sudo mkdir /usr/local/include/sys
sudo ln -s /usr/include/linux/sysctl.h /usr/local/include/sys/sysctl.h

Worked for me. Thanks for the tip @raymondtay!

@blalockma Thanks,it works

@serkanerip
Copy link

#77 should fix the problem on the linux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants