assert.h no such file or directory (Ubuntu 20.04 arm64)

I tried to solve this problem by installing the various libraries but still nothing. Advice?

enter image description here

I checked the include path:

enter image description here

parallels@ubuntu-linux-20-04-desktop:~$ locate /assert.h | grep assert.h$
/opt/ros/noetic/include/ros/assert.h
/usr/aarch64-linux-gnu/include/assert.h
/usr/include/assert.h
parallels@ubuntu-linux-20-04-desktop:~$ dpkg -l | grep libc6-dev
ii libc6-dev:arm64 2.31-0ubuntu9.3 arm64 GNU C Library: Development Libraries and Header Files
ii libc6-dev-arm64-cross 2.31-0ubuntu9.2cross1 all GNU C Library: Development Libraries and Header Files (for cross.compliling)
parallels@ubuntu-linux-20-04-desktop:~$ dpkg -L libc6-dev-arm64-cross | grep assert.h
/usr/aarch64-linux-gnu/include/assert.h

1 Answer

Install libc6-dev-arm64-cross with

sudo apt-get install libc6-dev-arm64-cross

The file list includes assert.h. So if you install this package, the file will be in your system.

If, when compiling, the header is not found, then it is because it is not in the search path. So you should clarify exactly which commands/package you used to try compiling.

Check your include path with

avr-gcc -xc -E -v -

or

echo | gcc -Wp,-v -x c++ - -fsyntax-only

Also check where is assert.h located with

sudo updatedb
locate /assert.h | grep assert.h$

If these do not match (I wouldn't know why this is not set correctly automatically), as a workaround you can add the path by hand. You can also try setting it more permanently.

See also


It helps if you post the output of the following commands

dpkg -l | grep libc6-dev
dpkg -L libc6-dev-arm64-cross | grep assert.h

It is much more useful if you copy-paste the text and format as code, instead of images (a little more work for you, though).

10

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like