Compilation error "fatal error: 'xxxx. H' file not found"

Source: Internet
Author: User
Tags sleep

This compilation error occurs when compiling an open-source project:

Fatal error: 'libelf. H' file not found
# Include <libelf. h>
     ^
1 error generated.

The solution is to install the elfutils-libelf-devel package:

Yum install elfutils-libelf-devel

Or:

Dnf install elfutils-libelf-devel


No error is found in the elf. h file when the Nexus 7 Android kernel is compiled on Mac OS X.

Nexus 7 encountered a fatal error when compiling the Android kernel for Hillstone 10.8.4: the elf. h file could not be found:

/Volumes/Android/WORKING_DIRECTORY/device/asus/grouper/tegra/
[Derek @ retina-mbp] $ make
Scripts/kconfig/conf -- silentoldconfig Kconfig
CHK include/linux/version. h
UPD include/linux/version. h
CHK include/generated/utsrelease. h
UPD include/generated/utsrelease. h
Generating include/generated/mach-types.h
CC kernel/bounds. s
GEN include/generated/bounds. h
CC arch/arm/kernel/asm-offsets.s
GEN include/generated/asm-offsets.h
CALL scripts/checksyscils. sh
CC scripts/mod/empty. o
HOSTCC scripts/mod/mk_elfconfig
Scripts/mod/mk_elfconfig.c: 4: 10: fatal error: 'Elf. H' file not found
# Include <elf. h>
         ^
1 error generated.
Make [2]: *** [scripts/mod/mk_elfconfig] Error 1
Make [1]: *** [scripts/mod] Error 2
Make: *** [scripts] Error 2

No one knows how to fix this problem. Can I continue to compile the kernel?

Solution 1:

I answered my own question because I found an alternative to the lost elf. h file:

Cd/Volumes/Android/WORKING_DIRECTORY/external/elfutils/libelf/
$ Sudo cp-a elf. h/usr/include

Unlike the current copy of the elf. h file in/usr/include, the file is compiled for a while and then stopped again. Different errors occur:

Arch/arm/mach-tegra/sleep. S: Runner messages:
Arch/arm/mach-tegra/sleep. S: 240: Error: selected processor does not support ARM mode 'smc #0'
Make [1]: *** [arch/arm/mach-tegra/sleep. o] Error 1
Make: *** [arch/arm/mach-tegra] Error 2

I don't know what to do though this is the last error.

Update: I have abandoned the attempt to compile the Android kernel directly under OS X. I started to install 64-bit Ubuntu, and then found the instructions on this page:

Http://forum.xda-developers.com/showthread.php? T = 1774035

Except as I said, I do not recommend the above pages as the start and VMWare players. It works very well. I have not encountered any problems with network connections. I can ssh to Ubuntu to easily move the compiled kernel back to OS X.

I also mentioned this page to get the correct kernel source code for my device (grouper), pre-built GCC, and syntax for making the command (to make tegra3_android_defconfig ):

Http://source.android.com/source/building-kernels.html

I hope this answer will save lives for a while.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.