Industriële fabricage
Industrieel internet der dingen | Industriële materialen | Onderhoud en reparatie van apparatuur | Industriële programmering |
home  MfgRobots >> Industriële fabricage >  >> Industrial programming >> C Taal

Je C-ontwikkelomgeving opzetten: Essentiële tools & tips

Benodigdheden

Voor C-programmeren heb je twee dingen nodig:

  1. Teksteditor – om broncode te schrijven
  2. C-compiler – om broncode om te zetten naar machinecode

Teksteditors

  • Windows: Notepad, Notepad++, VS Code, Sublime Text
  • Linux/UNIX: vi, vim, nano, emacs, VS Code, gedit
  • macOS: Xcode, VS Code, vim, BBEdit

Bronbestanden krijgen de extensie .c.

De C-compiler

De meest gebruikte gratis compiler is GCC (GNU Compiler Collection), beschikbaar voor C en C++. Alternatieven: Clang (LLVM), MSVC (Windows), vendor-specifieke compilers (HP, Solaris).

Installatie per platform

Linux / UNIX

Controleer of GCC geïnstalleerd is:

$ gcc --version

Als niet: installeer via pakketbeheerder (bijv. sudo apt install build-essential op Ubuntu/Debian, sudo dnf install gcc op Fedora). Zie gcc.gnu.org/install/ voor broncode-installatie.

macOS

Installeer Xcode Command Line Tools:

$ xcode-select --install

Of download volledige Xcode via de App Store / developer.apple.com.

Windows

Opties:

  • MinGW-w64 (via mingw-w64.org of winlibs.com voor standalone builds)
  • MSYS2 – biedt een Unix-achtige omgeving met pacman-pakketbeheer (pacman -S mingw-w64-x86_64-gcc)
  • WSL (Windows Subsystem for Linux) – draai echte Linux GCC (sudo apt install build-essential)
  • Visual Studio – bevat MSVC (Microsoft C/C++ compiler)

Voeg de bin-map van je compiler toe aan de PATH-omgevingsvariabele.

Testen

$ gcc --version
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.

Nu kun je gcc, g++, make, gdb, etc. vanaf de commandoregel gebruiken.

C Taal

  1. Een Live IP-camera Instellen op Raspberry Pi met Motion – Stap-voor-Stap Gids
  2. 15 Beste C++ IDE's voor Windows, macOS & Linux – Gratis & Betaalde Opties (2021)
  3. Uitgebreide Handleiding voor het Opzetten van uw C++ Ontwikkelomgeving
  4. C# Ontwikkelomgeving: Tools & .NET Framework Overzicht
  5. Uitgebreide Gids voor het Opzetten van je Python Ontwikkelomgeving
  6. Java Ontwikkelomgeving Instellen: Handleiding
  7. Java 10 Ontwikkelomgeving instellen: Bouwen, compileren en uitvoeren
  8. Java 10: Experimentele Graal JIT-compiler ontgrendelen
  9. Java 9 Ontwikkelomgeving Installatiehandleiding
  10. Java 8 Installatie: Eenvoudige omgevingsconfiguratie handleiding
  11. Textielkleurstoffen: Hun milieueffect & duurzame alternatieven