2.2 KiB
2.2 KiB
cli commands for different programming languages
- C
Requiments : gcc in linux and mingw in windows
For build system : meson, cmake,pkg-config
configuration file : Makefile
#include <stdio.h> int main() { // printf() displays the string inside quotation printf("Hello, World!"); return 0; }- Compiling and running
gcc hello.c -o helloAdditionally to link packages use
this will compile and create a binary file namedgcc `pkg-config --cflags gtk+-3.0` -o main1 main.c `pkg-config --libs gtk+-3.0`helloRunning it./hello - Compiling and running
- C++
// Your First C++ Program #include <iostream> int main() { std::cout << "Hello World!"; return 0; }- compiling and running
g++ hello.cpp -o helloand./helloto run
Additionally to link packagesg++ main.cpp -Ifltk-1.3.9 -Lfltk-1.3.9/lib -lfltk -lX11 -lXfixes -lXext -lXft -lXrender -lfontconfig -lXcursor -lXinerama -ldl -o main
- compiling and running
- Java
Requirements : openjdk installed
Build systems : maven/gradle(optional) for extra packages
Config files : pom.xml for maven and build.gradle for gradle
Compiling and running it// Your First Program class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); } }javac hellothis will create a bytecode namedHelloWorld.classto execute the bytecodejava HelloWorldTheory bytecode is the low level, platform independent code and when we use java command for bytecode it executes in JVM(Java Virtual Machine). This JVM converts bytecode into machine language and then executes it Compiling and running with mavenmvn packageto build itmvn spring-boot:runto run the sprint boot app - Javascript
Requirements : node installed
Build systems : npm/yarn for managing packages
Config files : package.json
Runningconsole.log('Hello World!')node hello.jsfor packagesnpm inpm start - python
Requirements : python 3.x installed
Build system : pip for managing packages
Config file : requirements.txt
Runningprint("Hello World!")python hello.pyfor packagespip install requiremnts.txtpython main.py