[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
/g/ installed Linux Debian. How can I write code, compile and
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 20
Thread images: 3
/g/ installed Linux Debian. How can I write code, compile and run it from terminal (I don't want to touch mouse).
>>
bumping my own thread
>>
>>52212761
What language nigger?
>>
>>52212761
What language faggot?
>>
>>52213691
>>52213718
c++
>>
>>52213743
To code you can use Nano or Pico.
To compile use g++
To execute ./
There is no need to use mouse for that
>>
>>52213793
Thanks. Now fuck off mouse
>>
>>52213821
I recomend learning vim. Once you git gud it becomes painfully slow using anything else.
>>
>>52212761
>>52213793
also possible to use any other editor of your choice, like vim or emacs or ed.
>>
>>52213842
will try it too
>>
>>52213793
hey how to save your master piece in nano?
>>
File: gnu-linux-c-c++compile-demo.gif (192 KB, 567x339) Image search: [Google]
gnu-linux-c-c++compile-demo.gif
192 KB, 567x339
first install GNU C/C++ compiler

$ sudo apt-get update
$ sudo apt-get install build-essential manpages-dev

You might already have it on debian, at least you do on ubuntu... Check it with:

$ whereis gcc
$ which gcc
$ gcc --version

Then write your code using a text editor like VI, Emacs, Sublime Text, Textadept or what ever text editor. Some of these have quite a learning curve, but you can use any. And you can configure the stuff you want in them. Sublime text is the most modern looking and one of the easiest while still having tons of customization, but it is not fully terminal based like vi, emacs or nano.

After that just write

$ gcc program-source-code.c -o executable-file-name

or assuming that executable-file-name.c exists

$ make executable-file-name

If you get no errors everything should be fine and you can verify it with

$ ls

and you can run it with

$ ./executable-file-name

where "./" just means "this folder". My picture shows a example demo.
>>
>>52213916
>>52213916
Ctrl + O to save
Ctrl + X To exit
>>
>>52213992
Thanks
>>
>>52213888
Try first with nano or pico are easy and simple to use , dont fuck around with vi if you are learning or you will finish the day killing yourself or worst going back to windows
>>
hey how can i display the output properly ?
>>
>>52214148
Post your code of your printf or cout , probably you just need to add an endofline and thats it
>>
>>52214225
thanks. Anything else i need to know before i ask some more shitty question.
>>
>>52212761
1.install g++/clang
2.install vim or emacs
3.fuck off
>>
>>52214148

also get a shell that doesn't suck, zsh will automatically resume prompt on a new line if the last run command doesn't explicitly end in one.
Thread replies: 20
Thread images: 3

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.