Skip to content

AdelinePat/myDiscord

Repository files navigation

PROCEDURE INSTALLATION INTERFACE GRAPHIQUE

  1. Installer WSL(C’est un sous-système Linux intégré à Windows.)
    util pour installer ubuntu
    Ouvre PowerShell avec win+R en administrateur et tape :
wsl --install  

💡 Ça va installer WSL 2 avec Ubuntu automatiquement.
Redémarre ensuite le PC.

  1. Ouvrir Unbuntu(environnemnet de bureau) :
  • Après le redemarrage du PC, :
  • Chercher "UBUNTU" dans le menu Démarrer :
  • Lance-le une première fois, attendre l'installation
  • Créér son nom utilisateur Linux et MDP
  1. Installation outils dans Ubuntu
sudo apt update
sudo apt install build-essential libgtk-3-dev pkg-config
  1. ouvrir Vscode avec ubunto :
    Ajouter extension WSL

A utiliser dans vscode

sudo apt update
sudo apt install libgtk-3-dev  
  1. Créer fichier example.c
#include <gtk/gtk.h>

static void activate(GtkApplication* app, gpointer user_data) {
    GtkWidget *window;
    window = gtk_application_window_new(app);
    gtk_window_set_title(GTK_WINDOW(window), "Hello GTK");
    gtk_window_set_default_size(GTK_WINDOW(window), 300, 100);
    gtk_widget_show_all(window);
}

int main(int argc, char **argv) {
    GtkApplication *app;
    int status;

    app = gtk_application_new("org.example.myapp", G_APPLICATION_FLAGS_NONE);
    g_signal_connect(app, "activate", G_CALLBACK(activate), NULL);
    status = g_application_run(G_APPLICATION(app), argc, argv);
    g_object_unref(app);

    return status;
}


  1. Installation serveur affichage - GTK :

Installe un serveur d'affichage comme VcXsrv sur ton Windows
parce que linux n'affiche pas nativemnet des interfaces graphiques sous windows

https://vcxsrv.com/  

Dans Ubuntu, il faut taper :

export DISPLAY=:0  
  1. Compiler le programme
    Dans le terminal Ubuntu dans VScode, compile avec :
gcc example.c -o mon_app `pkg-config --cflags --libs gtk+-3.0`  
  1. Lance l'application avec :
./mon_app
  1. Pour les commandes run et compile :
    utiliser le terminal TMX
https://www.msys2.org/  

faire dans le jaune puis dans le bleu

About

First year IT Bachelor group project : create a discord like application using only C

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •