Setting up a Dev Env in Ubuntu Linux

Post a reply

This question is a means of preventing automated form submissions by spambots.
:smile: :sad: :eek: :shock: :cool: :-x :razz: :oops: :evil: :twisted: :wink: :idea: :arrow: :neutral: :mrgreen:

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review

Expand view Topic review: Setting up a Dev Env in Ubuntu Linux

Re: Setting up a Dev Env in Ubuntu Linux

by Jizaboz » Fri Dec 20, 2019 12:54 am

Note: This assumes you installed Linux for "hacking the planet" and you already can build C code. If not, run:

sudo apt-get install build-essential

Setting up a Dev Env in Ubuntu Linux

by Jizaboz » Fri Dec 20, 2019 12:49 am

Here I will go through my steps with installing the Hugo Unix compiler in Ubuntu Light on a spare and crappy laptop!

- Downloaded newest version from BitBucket via URL
- Renamed folder to simply "Hugo" in my Home folder.

Attempt #1:

gumby@DEATH:~/Hugo$ make

(I get normal Hugo make messages until the following)

gcc/hegcc.c:41:10: fatal error: ncurses.h: No such file or directory
#include <ncurses.h>
compilation terminated.
Makefile:211: recipe for target 'hegcc.o' failed
make[1]: *** [hegcc.o] Error 1
make[1]: Leaving directory '/home/gumby/Hugo'
Makefile:177: recipe for target 'all' failed
make: *** [all] Error 2

Then I ran:

sudo apt-get update
sudo apt-get upgrade

(Restarted laptop to make sure new Linux kernel boots clean)

gumby@DEATH:~/Hugo$ sudo apt-get install ncurses
[sudo] password for gumby:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package ncurses

"Well, shit. In fact, CURSES!!"

gumby@DEATH:~/Hugo$ sudo apt-get install libncurses5-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
linux-headers-4.15.0-64 linux-headers-4.15.0-64-generic
linux-image-4.15.0-64-generic linux-modules-4.15.0-64-generic
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
Suggested packages:
The following NEW packages will be installed:
libncurses5-dev libtinfo-dev
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 256 kB of archives.
After this operation, 1,422 kB of additional disk space will be used.
Do you want to continue? [Y/n]

"Alright alright.."

Get:1 bionic-updates/main amd64 libtinfo-dev amd64 6.1-1ubuntu1.18.04 [81.3 kB]
Get:2 bionic-updates/main amd64 libncurses5-dev amd64 6.1-1ubuntu1.18.04 [174 kB]
Fetched 256 kB in 0s (635 kB/s)
Selecting previously unselected package libtinfo-dev:amd64.
(Reading database ... 220584 files and directories currently installed.)
Preparing to unpack .../libtinfo-dev_6.1-1ubuntu1.18.04_amd64.deb ...
Unpacking libtinfo-dev:amd64 (6.1-1ubuntu1.18.04) ...
Selecting previously unselected package libncurses5-dev:amd64.
Preparing to unpack .../libncurses5-dev_6.1-1ubuntu1.18.04_amd64.deb ...
Unpacking libncurses5-dev:amd64 (6.1-1ubuntu1.18.04) ...
Setting up libtinfo-dev:amd64 (6.1-1ubuntu1.18.04) ...
Setting up libncurses5-dev:amd64 (6.1-1ubuntu1.18.04) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...

"OK. Let's try to make the compiler again.."

Now I see output ending in the follwing instead of an error:

cc -pipe -O2 -Wall -Wextra -pedantic -o hd he.o heexpr.o hemisc.o heobject.o heparse.o herun.o heres.o heset.o stringfn.o hegcc.o hd.o hddecode.o hdmisc.o hdtools.o hdupdate.o hdval.o hdwindow.o hdgcc.o -lncurses -ltinfo
make[1]: Leaving directory '/home/gumby/Hugo'

"Cool. Let's test executing the binary.."

gumby@DEATH:~/Hugo$ ./hc
HUGO COMPILER v3.1.04 by Kent Tessman (c) 1995-2009
The General Coffee Company Film Productions
Unix port by Bill Lash