Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to make on Ubuntu 18 LTS #49

Open
rabollig opened this issue Oct 26, 2020 · 5 comments
Open

Unable to make on Ubuntu 18 LTS #49

rabollig opened this issue Oct 26, 2020 · 5 comments

Comments

@rabollig
Copy link

When trying to make on Ubuntu, I get these errors:

root@hackme:~/endlessh# ls
Dockerfile  endlessh.1  endlessh.c  Makefile  README.md  UNLICENSE  util
root@hackme:~/endlessh# make
cc -std=c99 -Wall -Wextra -Wno-missing-field-initializers -Os  -ggdb3 -o endlessh endlessh.c 
make: cc: Command not found
Makefile:12: recipe for target 'endlessh' failed
make: *** [endlessh] Error 127
root@hackme:~/endlessh# make LDLIBS=-lrt
cc -std=c99 -Wall -Wextra -Wno-missing-field-initializers -Os  -ggdb3 -o endlessh endlessh.c -lrt
make: cc: Command not found
Makefile:12: recipe for target 'endlessh' failed
make: *** [endlessh] Error 127
root@hackme:~/endlessh# make CC=gcc LDLIBS='-lnsl -lrt -lsocket'
gcc -std=c99 -Wall -Wextra -Wno-missing-field-initializers -Os  -ggdb3 -o endlessh endlessh.c -lnsl -lrt -lsocket
make: gcc: Command not found
Makefile:12: recipe for target 'endlessh' failed
make: *** [endlessh] Error 127
root@hackme:~/endlessh# lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.5 LTS
Release:	18.04
Codename:	bionic
root@hackme:~/endlessh# 

libc6-dev is installed.

Any advice?

@skeeto
Copy link
Owner

skeeto commented Oct 26, 2020 via email

@rabollig
Copy link
Author

Thanks. You're correct, my bootstrap didn't have build-essentials, but after installing it we're still stuck.

root@hackme:~/endlessh# apt-get install build-essential
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  binutils binutils-common binutils-x86-64-linux-gnu cpp cpp-7 dpkg-dev fakeroot g++ g++-7 gcc gcc-7 gcc-7-base
  libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan4 libatomic1 libbinutils libcc1-0
  libcilkrts5 libdpkg-perl libfakeroot libfile-fcntllock-perl libgcc-7-dev libgomp1 libisl19 libitm1 liblsan0 libmpc3
  libmpx2 libquadmath0 libstdc++-7-dev libtsan0 libubsan0
Suggested packages:
  binutils-doc cpp-doc gcc-7-locales debian-keyring g++-multilib g++-7-multilib gcc-7-doc libstdc++6-7-dbg
  gcc-multilib autoconf automake libtool flex bison gdb gcc-doc gcc-7-multilib libgcc1-dbg libgomp1-dbg libitm1-dbg
  libatomic1-dbg libasan4-dbg liblsan0-dbg libtsan0-dbg libubsan0-dbg libcilkrts5-dbg libmpx2-dbg libquadmath0-dbg bzr
  libstdc++-7-doc
The following NEW packages will be installed:
  binutils binutils-common binutils-x86-64-linux-gnu build-essential cpp cpp-7 dpkg-dev fakeroot g++ g++-7 gcc gcc-7
  gcc-7-base libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan4 libatomic1 libbinutils
  libcc1-0 libcilkrts5 libdpkg-perl libfakeroot libfile-fcntllock-perl libgcc-7-dev libgomp1 libisl19 libitm1 liblsan0
  libmpc3 libmpx2 libquadmath0 libstdc++-7-dev libtsan0 libubsan0
0 upgraded, 35 newly installed, 0 to remove and 14 not upgraded.
Need to get 37.0 MB of archives.
After this operation, 136 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 binutils-common amd64 

[snip]

Setting up cpp (4:7.4.0-1ubuntu2.3) ...
Setting up binutils (2.30-21ubuntu1~18.04.4) ...
Setting up gcc-7 (7.5.0-3ubuntu1~18.04) ...
Setting up g++-7 (7.5.0-3ubuntu1~18.04) ...
Setting up gcc (4:7.4.0-1ubuntu2.3) ...
Setting up dpkg-dev (1.19.0.5ubuntu2.3) ...
Setting up g++ (4:7.4.0-1ubuntu2.3) ...
update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode
Setting up build-essential (12.4ubuntu1) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for libc-bin (2.27-3ubuntu1.2) ...
root@hackme:~/endlessh# make
cc -std=c99 -Wall -Wextra -Wno-missing-field-initializers -Os  -ggdb3 -o endlessh endlessh.c 
root@hackme:~/endlessh# 

Something still being missing makes sense.

I can compile it as shown in the Dockerfile, so I can maybe copy it from there (or just run it in Docker). It's a fun little program and I'm thinking of running it on lots of IoT devices, some of which don't meet Docker system requirements, though.

@rabollig
Copy link
Author

Do dice copying it from the Dockerfile. I get -bash: ./endlessh: No such file or directory when running the file, even after giving it execute permissions.

@hamburghammer
Copy link

Do dice copying it from the Dockerfile. I get -bash: ./endlessh: No such file or directory when running the file, even after giving it execute permissions.

If you copy the executable from the Docker image you have still the issue that you are still missing some system libs to run it.
I got it running on Ubuntu 18.04.5 LTS with on the latest commit installing build-essential and running make install but I don't know if it helps you.

@meffie96
Copy link

You might be missing the package libc6-dev. Install it and give it a try!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants