Linux types h no such file

linux/compiler-gcc6.h: No such file or directory #2762

Comments

aleisterdev commented Sep 5, 2016

Please describe your issue:

I get en error about a missing gcc6.h when compiling

If known, describe the steps to reproduce the issue:

When arrived to the command:
$ make-kpkg —rootcmd fakeroot kernel_image kernel_headers

In file included from include/linux/compiler.h:54:0,
from include/uapi/linux/stddef.h:1,
from include/linux/stddef.h:4,
from ./include/uapi/linux/posix_types.h:4,
from include/uapi/linux/types.h:13,
from include/linux/types.h:5,
from include/linux/page-flags.h:8,
from kernel/bounds.c:9:
include/linux/compiler-gcc.h:107:30: fatal error: linux/compiler-gcc6.h: No such file or directory
#include gcc_header(GNUC)
^
compilation terminated.
Kbuild:35: recipe for target ‘kernel/bounds.s’ failed
make[3]: *** [kernel/bounds.s] Error 1
Makefile:1006: recipe for target ‘prepare0’ failed
make[2]: *** [prepare0] Error 2
make[2]: Leaving directory ‘/home/kali/kernel’
debian/ruleset/targets/common.mk:194: recipe for target ‘debian/stamp/conf/kernel-conf’ failed
make[1]: *** [debian/stamp/conf/kernel-conf] Error 2
make[1]: Leaving directory ‘/home/kali/kernel’
/usr/share/kernel-package/ruleset/minimal.mk:93: recipe for target ‘debian/stamp/conf/minimal_debian’ failed
make: *** [debian/stamp/conf/minimal_debian] Error 2
Failed to create a ./debian directory: No such file or directory at /usr/bin/make-kpkg line 970.

But of course:
(kali-rolling)kali@localhost:

/kernel$ sudo apt-get install gcc-6 g++-6
Reading package lists. Done
Building dependency tree
Reading state information. Done
g++-6 is already the newest version (6.1.1-11).
g++-6 set to manually installed.
gcc-6 is already the newest version (6.1.1-11).
gcc-6 set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

That’s not the first time that I had this issue, I had it also when compiling the drivers for my wifi adapter.
Can someone help me with this please?
I’m compiling the kernel headers:
3.18.0-12320-gf988d48
That’s the version I have on: $ uname -r
3.18.0-12320-gbb6b499

I know that the last bit is different and not sure if it matters.
The commit for that kernel was found with:
kali@localhost: /kernel$ git checkout HEAD 675

Any other number different from 675 would have changed the «12320» part of the kernel version.

The text was updated successfully, but these errors were encountered:

Источник

error compiling: linux/module.h: No such file or directory

I’ve written a simple module:

and compiling it with this command:

but I’m getting this error:

EDIT: I used this commad:

and it goes one step ahead, now I get this error:

5 Answers 5

First thing you need the kernel sources. Many confuse user space headers and kernel space headers because many of them have the same folder structure. Most of the distros only have the user space headers and not the kernel space ones.

And generally make is used to build a kernel module and not a bare cc . Follow the simple step-by-step explained Hello World kernel module given here

Читайте также:  Сетевой интерфейс windows server

Source file name is basic.c

now make file for ubuntu

At first type on ur terminal that $(uname -r) then u will get the version.. that is using on ur system

To run the code

You need the kernel headers; they are usually in /usr/include/ if installed.

Unless you are using a source-based distro or built your own kernel chances are good they are not installed by default; use your distro’s package manager to install them. The package is often called linux-headers .

You need the kernel build environment (selection of scripts, header and Makefiles) usually this is reachable through /lib/modules/version/build (a symlink to it) if a kernel has been installed already. Otherwise, the directory is the build directory (the one where System.map is in). Full sources are not needed (smart distros recognize this), and neither is /usr/include/whatever.

You also must use kbuild; calling cc -I is not enough, and has not been for more than 10 years. You start off with a Kbuild file:

and then utilize make .

#defining __KERNEL__ and MODULE is also pointless, because that is already set by kbuild if needed.

Most Linux distros don’t install kernel headers as default. Look for a package kernel-headers or something similar.

Источник

asm/errno.h: No such file or directory

While building gcc, I get this error:

I am building gcc 4.1 from source. I think I have to install build-essential . However installing that package in ubuntu 12.04 will automatically download and install gcc 4.6 and I don’t want that.

Is there any other way?

11 Answers 11

I think the package you want is linux-libc-dev . I encountered this when building 32-on-64; so I needed linux-libc-dev:i386 .

340k. dpkg -L linux-libc-dev | diff -ur — shows that both packages provide the same files outside the arch-specific include directory.

This worked for me:

This worked for me:

The reason being that what GCC expects to be called /usr/include/asm is renamed to /usr/include/asm-generic in some distros.

This fixed it for me.

/usr/include/asm/errno.h is part of the linux headers. I can’t speak directly to Ubuntu 12.04, but in general you can download the linux sources as a package for your distro and it shouldn’t require you to download/install gcc. Failing that, you can manually download the linux headers for the version of your kernel ( uname -a ) and use an include directive to CFLAGS to specify the directory to look for those.

Edit: sudo apt-get install linux-headers-generic may work for you.

This solved it for me on Debian 10, even though I was compiling with an LLVM-based compiler:

You are missing part of the development packages. I don’t know Ubuntu, but you should be able to ask it’s package management system to install the package containing /usr/include/asm/errno.h .

Do not copy some file with a similar name from somewhere on your system (or, even worse, from somewhere else). Missing files might mean that some package is damaged; again, ask your package manager to check everything and (re)install missing/broken pieces.

Читайте также:  Как открыть второе пространство windows

Unless you are running some LTS release, upgrade. Your Ubuntu is some 2 years old, i.e., ancient.

While we are at this, why on this beautiful planet are you building such an ancient compiler? Current GCC is just released 4.9.0, anything before 4.7 is ancient history, not longer supported.

Источник

linux/module.h: No such file or directory

i’m a beginner and i’m trying out some basics of kernel programming in linux. Today morning i’ve opened the module.h file in VIM, and closed without saving any changes as well. After that i’m not able to compile any of my codes. I’m getting the following error message

Here is a sample code which was running successfully till the last day.

I searched for the module.h file like the following and it do exist

Please help me out. I’m using CentOS in virtual box.

3 Answers 3

You’re trying to compile your module with plain gcc with none of the surrounding kbuild framework. You might have gotten something to work in the past with this approach, but it is painful horrible awful to try to maintain a module using anything other than pure-kbuild Makefile approaches. I’ve wasted too much of my life fighting against kbuild and I don’t want the same to happen with you — embrace kbuild and let it help you build your module. Please read Documentation/kbuild/modules.txt before writing another line of code.

What you need to do is create a Makefile for your module. Its contents should look like this:

I know it’s a lot more complicated than most Makefile s you’re used to seeing, but it serves a dual-purpose. If you just run make in your directory, it’ll re-invoke make to use the kbuild mechanism from the currently-running kernel (assumed to at least have a symlink from /lib/modules/. /build to the correct location).

The re-invoked make command ( $(MAKE) ) will properly build your module and save you more time than you can ever appreciate. (Really.)

Источник

zmq.h and linux/tipc.h : No suchfile or directory in docker build #581

Comments

esevan commented Feb 20, 2019

Docker build for enterprise_gateway raised following errors.

/tmp/timer_createF_vacI.c: In function ‘main’: /tmp/timer_createF_vacI.c:2:5: warning: implicit declaration of function ‘timer_create’ [-Wimplicit-function-declaration] timer_create(); ^

gcc build/temp.linux-x86_64-2.7/scratch/tmp/timer_createF_vacI.o -o build/temp.linux-x86_64-2.7/scratch/a.out gcc -fno-strict-aliasing -Os -fomit-frame-pointer -g -DNDEBUG -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -Izmq/utils -Izmq/backend/cython -Izmq/devices -c build/temp.linux-x86_64-2.7/scratch/vers.c -o build/temp.linux-x86_64-2.7/scratch/vers.o build/temp.linux-x86_64-2.7/scratch/vers.c:4:17: fatal error: zmq.h: No such file or directory #include «zmq.h» ^ compilation terminated. error: command ‘gcc’ failed with exit status 1 Failed with default libzmq, trying again with /usr/local <'libraries': ['zmq'], 'extra_link_args': [], 'runtime_library_dirs': ['/usr/local/lib'], 'library_dirs': ['/usr/local/lib'], 'include_dirs': ['/usr/local/include']>************************************************ Configure: Autodetecting ZMQ settings. Custom ZMQ dir: /usr/local gcc -fno-strict-aliasing -Os -fomit-frame-pointer -g -DNDEBUG -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -c /tmp/timer_createnzBgNU.c -o build/temp.linux-x86_64-2.7/scratch/tmp/timer_createnzBgNU.o /tmp/timer_createnzBgNU.c:1:1: warning: return type defaults to ‘int’ [-Wimplicit-int] main (int argc, char **argv) < ^

Читайте также:  Download windows folders icons

/tmp/timer_createnzBgNU.c: In function ‘main’: /tmp/timer_createnzBgNU.c:2:5: warning: implicit declaration of function ‘timer_create’ [-Wimplicit-function-declaration] timer_create(); ^

Assembler messages: Fatal error: can’t create build/temp.linux-x86_64-2.7/scratch/tmp/timer_createnzBgNU.o: No such file or directory gcc -fno-strict-aliasing -Os -fomit-frame-pointer -g -DNDEBUG -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/local/include -Izmq/utils -Izmq/backend/cython -Izmq/devices -c build/temp.linux-x86_64-2.7/scratch/vers.c -o build/temp.linux-x86_64-2.7/scratch/vers.o build/temp.linux-x86_64-2.7/scratch/vers.c:4:17: fatal error: zmq.h: No such file or directory #include «zmq.h» ^ compilation terminated. error: command ‘gcc’ failed with exit status 1 ************************************************ Warning: Couldn’t find an acceptable libzmq on the system. If you expected pyzmq to link against an installed libzmq, please check to make sure: * You have a C compiler installed * A development version of Python is installed (including headers) * A development version of ZMQ >= 3.2 is installed (including headers) * If ZMQ is not in a default location, supply the argument —zmq=

* If you did recently install ZMQ to a default location, try rebuilding the ld cache with `sudo ldconfig` or specify zmq’s location with `—zmq=/usr/local` You can skip all this detection/waiting nonsense if you know you want pyzmq to bundle libzmq as an extension by passing: `—zmq=bundled` I will now try to build libzmq as a Python extension unless you interrupt me (^C) in the next 10 seconds. 1. ************************************************ Using bundled libzmq already have bundled/zeromq attempting ./configure to generate platform.hpp Warning: failed to configure libzmq: /bin/sh: ./configure: No such file or directory staging platform.hpp from: buildutils/include_linux ************************************************ checking for timer_create creating build/temp.linux-x86_64-2.7/tmp gcc -fno-strict-aliasing -Os -fomit-frame-pointer -g -DNDEBUG -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -c /tmp/timer_createmdQBot.c -o build/temp.linux-x86_64-2.7/tmp/timer_createmdQBot.o /tmp/timer_createmdQBot.c:1:1: warning: return type defaults to ‘int’ [-Wimplicit-int] main (int argc, char **argv) < ^

/tmp/timer_createmdQBot.c: In function ‘main’: /tmp/timer_createmdQBot.c:2:5: warning: implicit declaration of function ‘timer_create’ [-Wimplicit-function-declaration] timer_create(); ^

gcc build/temp.linux-x86_64-2.7/tmp/timer_createmdQBot.o -o build/temp.linux-x86_64-2.7/a.out ok ************************************************ building ‘zmq.libzmq’ extension creating build/temp.linux-x86_64-2.7/buildutils creating build/temp.linux-x86_64-2.7/bundled creating build/temp.linux-x86_64-2.7/bundled/zeromq creating build/temp.linux-x86_64-2.7/bundled/zeromq/src gcc -fno-strict-aliasing -Os -fomit-frame-pointer -g -DNDEBUG -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -DZMQ_HAVE_CURVE=1 -DZMQ_USE_TWEETNACL=1 -DZMQ_USE_EPOLL=1 -DZMQ_IOTHREADS_USE_EPOLL=1 -DZMQ_POLL_BASED_ON_POLL=1 -Ibundled/zeromq/include -Ibundled -I/usr/include/python2.7 -c buildutils/initlibzmq.c -o build/temp.linux-x86_64-2.7/buildutils/initlibzmq.o gcc -fno-strict-aliasing -Os -fomit-frame-pointer -g -DNDEBUG -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -DZMQ_HAVE_CURVE=1 -DZMQ_USE_TWEETNACL=1 -DZMQ_USE_EPOLL=1 -DZMQ_IOTHREADS_USE_EPOLL=1 -DZMQ_POLL_BASED_ON_POLL=1 -Ibundled/zeromq/include -Ibundled -I/usr/include/python2.7 -c bundled/zeromq/src/udp_engine.cpp -o build/temp.linux-x86_64-2.7/bundled/zeromq/src/udp_engine.o gcc -fno-strict-aliasing -Os -fomit-frame-pointer -g -DNDEBUG -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -DZMQ_HAVE_CURVE=1 -DZMQ_USE_TWEETNACL=1 -DZMQ_USE_EPOLL=1 -DZMQ_IOTHREADS_USE_EPOLL=1 -DZMQ_POLL_BASED_ON_POLL=1 -Ibundled/zeromq/include -Ibundled -I/usr/include/python2.7 -c bundled/zeromq/src/tcp.cpp -o build/temp.linux-x86_64-2.7/bundled/zeromq/src/tcp.o gcc -fno-strict-aliasing -Os -fomit-frame-pointer -g -DNDEBUG -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -DZMQ_HAVE_CURVE=1 -DZMQ_USE_TWEETNACL=1 -DZMQ_USE_EPOLL=1 -DZMQ_IOTHREADS_USE_EPOLL=1 -DZMQ_POLL_BASED_ON_POLL=1 -Ibundled/zeromq/include -Ibundled -I/usr/include/python2.7 -c bundled/zeromq/src/signaler.cpp -o build/temp.linux-x86_64-2.7/bundled/zeromq/src/signaler.o gcc -fno-strict-aliasing -Os -fomit-frame-pointer -g -DNDEBUG -Os -fomit-frame-pointer -g -DTHREAD_STACK_SIZE=0x100000 -fPIC -DZMQ_HAVE_CURVE=1 -DZMQ_USE_TWEETNACL=1 -DZMQ_USE_EPOLL=1 -DZMQ_IOTHREADS_USE_EPOLL=1 -DZMQ_POLL_BASED_ON_POLL=1 -Ibundled/zeromq/include -Ibundled -I/usr/include/python2.7 -c bundled/zeromq/src/tipc_connecter.cpp -o build/temp.linux-x86_64-2.7/bundled/zeromq/src/tipc_connecter.o In file included from bundled/zeromq/src/tipc_connecter.cpp:46:0: bundled/zeromq/src/tipc_address.hpp:43:24: fatal error: linux/tipc.h: No such file or directory #include
^ compilation terminated. error: command ‘gcc’ failed with exit status 1 «>

Solution: Install packages; zeromq-dev for zmq.h and linux-headers for linux/tipc.h

The text was updated successfully, but these errors were encountered:

Источник

Оцените статью