Linux assert h no such file or directory

Собираю reopenldap. Разыскивается ac/assert.h.

Написал для него spec-файл для rpm. Configure проходит нормально, есть строки

ac/localize.h в include есть, а ac/assert.h нет.

sudo cast ly .

Добавил в include/ac симлинк на /usr/include/assert.h , жаловаться перестал, но теперь жалуется на неизвестные атрибуты (я так понял они для msvc?):

Re: sudo casе ly 😉

Логичней было-бы добавить issue на github, на LOR не каждый день захожу.

  • Какую версию пробуете, spec в студию, etc.
  • configure.in устаревший, см. https://github.com/ReOpen/ReOpenLDAP/issues/5
  • Воскрешение ac/assert.h видимо отсюда.
  • Начинайте сборку без перестройки configure, иначе будет плохо.
  • Фильтровать кучу говна в configure.in не планируется, будет либо просто Makefile, либо cmake.

Белого пушистого релиза (с нормальными сценариями сборки) пока нет. Были планы сделать это летом, включая rpm, deb и т.д. Но всплыли баги в репликации, поэтому отложили.

С репликацией всё плохо, см. https://github.com/ReOpen/ReOpenLDAP/issues/43 Но это вершина айсберга, в нужном нам multi-master режиме исходно просто глюкало. понемногу переписываем.

P.S. Потерянные «неизвестные» атрибуты не из видны, они в include/reopenldap.h, см https://github.com/ReOpen/ReOpenLDAP/blob/master/include/reopenldap.h

Re2: sudo casе ly 😉

Если будут полезные правки — pls не забудьте сделать pull request или хотя-бы намылить.

Источник

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.

Читайте также:  Настройка клавиш переключения языка mac os

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.

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.

Источник

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

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.

Читайте также:  Mac os поддержка браузеров

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

Источник

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.)

Источник

«No such file or directory» error when executing a binary

I was installing a binary Linux application on Ubuntu 9.10 x86_64. The app shipped with an old version of gzip (1.2.4), that was compiled for a much older kernel:

I wasn’t able to execute this program. If I tried, this happened:

ldd was similarly unhappy with this binary:

I’m curious: What’s the most likely source of this problem? A corrupted file? Or a binary incompatibility due to being built for a much older ?

Per nos’s suggestsions, here’s the output of strace ./gzip :

Here’s the output of readelf -a ./gzip :

8 Answers 8

The answer is in this line of the output of readelf -a in the original question

I was missing the /lib/ld-linux.so.2 file, which is needed to run 32-bit apps. The Ubuntu package that has this file is libc6-i386.

Old question, but hopefully this’ll help someone else.

In my case I was using a toolchain on Ubuntu 12.04 that was built on Ubuntu 10.04 (requires GCC 4.1 to build). As most of the libraries have moved to multiarch dirs, it couldn’t find ld.so. So, make a symlink for it.

Читайте также:  Учебник windows 10 администратор

Check required path:

If you’re on 32bit, it’ll be i386-linux-gnu and not x86_64-linux-gnu.

You get this error when you try to run a 32-bit build on your 64-bit Linux.

Also contrast what file had to say on the binary you tried (ie: 32-bit) with what you get for your /bin/gzip :

which is what I get on Ubuntu 9.10 for amd64 aka x86_64.

Edit: Your expanded post shows that as the readelf output also reflects a 32-bit build.

I think you’re x86-64 install does not have the i386 runtime linker. The ENOENT is probably due to the OS looking for something like /lib/ld.so.1 or similar. This is typically part of the 32-bit glibc runtime, and while I’m not directly familiar with Ubuntu, I would assume they have some sort of 32-bit compatibility package to install. Fortunately gzip only depends on the C library, so that’s probably all you’ll need to install.

I also had problems because my program interpreter was /lib/ld-linux.so.2 however it was on an embedded device, so I solved the problem by asking gcc to use ls-uClibc instead as follows:

It is possible that the executable is statically linked and that is why ldd gzip does not see any links — because it isn’t. I don’t know much about things that far back so I don’t know if there would be incompatibilities if libraries are linked in statically. I might expect there to be.

I know it’s the most obvious thing going and I’m sure you’ve done it, but chmod +x ./gzip , yes? No such file or directory is a classic symptom of that not being done, that’s why I mention it.

Well another possible cause of this can be simple line break at end of each line and shebang line If you have been coding in windows IDE its possible that windows has added its own line break at the end of each line and when you try to run it on linux the line break cause problems

Not the answer you’re looking for? Browse other questions tagged linux or ask your own question.

Linked

Hot Network Questions

Subscribe to RSS

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. rev 2021.10.8.40416

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.

Источник

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