lxroot
lxroot copied to clipboard
Build error: "g++: No such file or directory"
make build command gave me the following error
g++ -g -fmax-errors=2 -Wall -Wextra unit.cpp -o bin/lxroot-unit
make: g++: No such file or directory
make: *** [Makefile:46: bin/lxroot-unit] Error 127
my current os
Ubuntu 22.04.1 LTS
Maybe g++ is not installed?
Try: sudo apt-get install build-essential
@parke Thank you very much for your quick response.
after installing the build essentials there is bin folder created with the following files
- lxroot
- lxroot-unit
then i tried
sudo make unit
and get the following error
unit.sh test fail
line 361
command env - ./lxr nr -- id -u
status 0
expect '0'
actual '0 0' length 4
cwd /tmp/lxroot-unit
env1 env -
lxr1
argv ./lxr nr -- id -u
cmd1
make: *** [Makefile:66: unit] Error 1
Maybe you are running as root?
Lxroot does not require root access.
Please try cloning/downloading, building, and running 'make unit' as a non-root user.
You probably need to delete the /tmp/lxroot-unit directory as it needs to be owned by the non-root user for the unit tests to succeed.
Thanks for the error report. I was unaware of this particular issue.
Update: The above unit test failure (on line 361
) is due to a flaw in the unit test, not a flaw in Lxroot. However, this flaw is only exposed when the unit tests are run as root. I will fix the unit test and push an update to Github.
I've pushed the fixed unit test to the master
branch: https://github.com/parke/lxroot/commit/dc153df1826851afa8fc5639016d53c08a2ef2bd
So after you do a git pull
, the unit tests should now pass (even if you run the unit tests as root).
To repeat myself: I recommend always building, testing, and running Lxroot as a non-root user.
A few of the unit tests are interactive. When prompted, you need to press y
and then ENTER
to pass these tests.
Thanks again for reporting this issue.
@parke You are great. I appreciate your hard work and enthusiasm.