Je veut m enservir de g++

momo -  
dindoun Messages postés 1047 Statut Membre -
Bonjour,
j ai fait un petit programme en langage c++, jai voulu le compiler et executer en utilisant g++ sous ubuntu que j ai installé enutilisant l'instalateur WUBI.
jai tappé la commande g++ -c prog.c
j ai eu le message suivant

The program 'g++' can be found in the following package
* g++
* pentium-builder
Try: sudo apt -get install <selected package>
bash: g++: command not found

j ai tappé which g++
j ai rien reçu comme message

si j ai bien compris g++ existe qulquepart mais je ne sais pas où
merci de m aider
Configuration: Windows XP
Firefox 1.5

7 réponses

  1. thorn
     
    salut,
    rpm c'est pour fedora et d'autres...
    tu trouveras tout ça dans synaptic dans la rubrique 'developpement' en
    installant les librairies systeme et les headers pour le C++, elles vont se mettre
    dans /usr/include/...et /lib. avec celles du C ...
    ensuite les fichers c++ se terminent par .cc
    0
  2. thorn
     
    non je te rassure, alien c'est juste un utilitaire rien à voir
    avec gcc et g++
    0
  3. dindoun Messages postés 1047 Statut Membre 135
     
    salut,

    dans ces programmes y a ce qu il te faut, prend tout ou fais le ménage

    sudo apt-get install alien audacity avidemux bittorrent bchunk cupsys  icedax cpp cups-pdf djvulibre-bin djvulibre-plugin dvipdfmx dvi2ps dvipng devtodo enscript e2ps filelight ffmpeg  gcc gcc-3.3-base gftp gimp  gqview gstreamer0.10-ffmpeg gstreamer0.10-plugins-ugly  gstreamer0.10-plugins-bad-multiverse gsfonts-x11 gphpedit gawk gnomebaker gparted  g++ gsfonts gif2png hexedit hdparm  imagemagick lshw language-pack-kde-fr-base language-support-fr lame liblame-dev libtiff-tools libc6 libdb1-compat markdown mozilla-firefox-locale-fr-fr   msttcorefonts mplayer mkvtoolnix* mencoder mplayer mdf2iso mozilla-plugin-vlc make mozilla-thunderbird mozilla-mplayer netpbm ntfsprogs nrg2iso openssh-client openssh-server psutils pstotext pstoedit poppler-utils qtparted  rar sane smartmontools sane-utils stellarium ssh sam2p tth totem-gstreamer unrar unzip  vlc webhttrack xfonts-100dpi xfonts-75dpi xpdf-common xpdf-reader xfonts-base xpdf xmlto  xsane xvid4conf zip libstdc++5 amule amule-utils mjpegtools g++-multilib g++-4.1-multilib gcc-4.1-doc xfsprogs reiser4progs jfsutils ntfsprogs php5-cli php-doc cdrkit-doc html2ps glibc-doc manpages-dev  fakeroot sidplay-base xsidplay libstdc++6-4.1-doc lib64stdc++6-4.1-dbg tetex-base weblint-perl xhtml2ps php-pear xfsdump attr dvhtool quota g++-multilib g++-4.1-multilib gcc-4.1-doc xfsprogs reiser4progs jfsutils ntfsprogs php5-cli php-doc cdrkit-doc html2ps glibc-doc manpages-dev fakeroot sidplay-base xsidplay libstdc++6-4.1-doc tetex-base weblint-perl xhtml2ps php-pear xfsdump attr dvhtool  kdevelop konsole alsa-oss teamspeak-client alsamixergui byzanz istanbul recordmydesktop magicrescue wesnoth kompozer hydrogen raptor-utils  smart-notifier libxft-dev  scribus* kdenlive  build-essential  checkinstall
    -1
    1. momo
       
      bonjour
      j ai rien compris
      est ce que vous pouvez comenter le message que je vous ai envoyé
      sinon donnez moi une methode explicite parcque je suis debutant
      merci
      0
  4. bob031 Messages postés 8228 Statut Membre 473
     
    salut,

    il te faut installer les paquets correspondant à gcc et g++

    pour gcc : c'est la même chose pour les différentes distributions linux

    pour g++ : le nom du paquetage peut varier selon la distribution

    voici pour moi sur la mandriva :
    [redfox@mandriva ~]$ whereis gcc
    gcc: /usr/bin/gcc /usr/bin/gcc4.2-version /usr/lib/gcc
    [redfox@mandriva ~]$ whereis g++
    g++: /usr/bin/g++
    [redfox@mandriva ~]$ rpm -qa | grep gcc
    libgcc1-4.2.3-6mnb1
    gcc-cpp-4.2.3-6mnb1
    gcc-4.2.3-6mnb1
    manbo-mandriva-files-gcc-4.2.3-6mnb1
    manbo-mandriva-files-gcc-c++-4.2.3-6mnb1
    gcc-c++-4.2.3-6mnb1
    [redfox@mandriva ~]$ rpm -qa | grep g++
    [redfox@mandriva ~]$

    en fait
    -1
    1. momo
       
      bonjour
      j ai essayé de faire ce que vous m avez donner
      pour whereis gcc j ai eu une repense ui resemble a la votre merci
      pour whereis g++ il m a rien donné
      pour rmp -qa | grep gcc il me donne command not found
      qu est ce que je doit faire maintenent la compilation me donne le message suivant
      prog.c:1:19: error: iostream: No such file or directory
      0
  5. Vous n’avez pas trouvé la réponse que vous recherchez ?

    Posez votre question
  6. bob031 Messages postés 8228 Statut Membre 473
     
    pour whereis g++ il m a rien donné

    normal puisque ta commande :
    which g++
    ne donnait rien !

    pour rmp -qa | grep gcc il me donne command not found

    normal puisque la commande rpm fonctionne pour les distributions redhat, mandriva et fedora.

    pour Ubuntu, je crois que c'est : apt-file search nom_du_paquetage

    qu est ce que je doit faire maintenent la compilation me donne le message suivant
    prog.c:1:19: error: iostream: No such file or directory


    surprenant que ton message d'erreur soit différent .... à moins d'avoir utilisé gcc au lieu de g++.
    -1
  7. dindoun Messages postés 1047 Statut Membre 135
     
    salut momo,
    ouvre un tereminal : dans le menu applications/accessoires/terminal
    ensuiet tu sélectionnes le texte , ( click droit, copier )
    puis tu colles dans le terminal ( click droit coller )
    il te demanderas le mot de passe

    concrètement, c ets un ligne qui permet d'installer plein de trucs qui servenbt à certains moment doverses dont celuy ide laa programmation en C++
    -1
    1. momo
       
      bonjour,
      j ai fait ce que vous m avez dit voila le message que j ai eu


      [sudo] password for maarouf:
      Lecture des listes de paquets... Fait
      Construction de l'arbre des dépendances
      Lecture des informations d'état... Fait
      E: Impossible de trouver le paquet alien

      vraiment je suis perdu la

      la je suis conncté est ce que je doit telecharger le paquet alien pour que ça marche
      0
  8. dindoun Messages postés 1047 Statut Membre 135
     
    salut,
    ton fichier /etc/apt/sources.list ne doit pas être bon :
    
    deb http://fr.archive.ubuntu.com/ubuntu/ hardy main restricted
    deb-src http://fr.archive.ubuntu.com/ubuntu/ hardy main restricted
    
    ## Major bug fix updates produced after the final release of the
    ## distribution.
    deb http://fr.archive.ubuntu.com/ubuntu/ hardy-updates main restricted
    deb-src http://fr.archive.ubuntu.com/ubuntu/ hardy-updates main restricted
    
    ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    ## team, and may not be under a free licence. Please satisfy yourself as to
    ## your rights to use the software. Also, please note that software in
    ## universe WILL NOT receive any review or updates from the Ubuntu security
    ## team.
    deb http://fr.archive.ubuntu.com/ubuntu/ hardy universe
    deb-src http://fr.archive.ubuntu.com/ubuntu/ hardy universe
    deb http://fr.archive.ubuntu.com/ubuntu/ hardy-updates universe
    deb-src http://fr.archive.ubuntu.com/ubuntu/ hardy-updates universe
    
    ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    ## team, and may not be under a free licence. Please satisfy yourself as to
    ## your rights to use the software. Also, please note that software in
    ## multiverse WILL NOT receive any review or updates from the Ubuntu
    ## security team.
    deb http://fr.archive.ubuntu.com/ubuntu/ hardy multiverse
    deb-src http://fr.archive.ubuntu.com/ubuntu/ hardy multiverse
    deb http://fr.archive.ubuntu.com/ubuntu/ hardy-updates multiverse
    deb-src http://fr.archive.ubuntu.com/ubuntu/ hardy-updates multiverse
    
    ## Uncomment the following two lines to add software from the 'backports'
    ## repository.
    ## N.B. software from this repository may not have been tested as
    ## extensively as that contained in the main release, although it includes
    ## newer versions of some applications which may provide useful features.
    ## Also, please note that software in backports WILL NOT receive any review
    ## or updates from the Ubuntu security team.
    #deb http://fr.archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse
    #deb-src http://fr.archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse
    
    ## Uncomment the following two lines to add software from Canonical's
    ## 'partner' repository. This software is not part of Ubuntu, but is
    ## offered by Canonical and the respective vendors as a service to Ubuntu
    ## users.
    deb http://archive.canonical.com/ubuntu/ hardy partner
    deb-src http://archive.canonical.com/ubuntu/ hardy partner
    
    deb http://security.ubuntu.com/ubuntu/ hardy-security main restricted
    deb-src http://security.ubuntu.com/ubuntu/ hardy-security main restricted
    deb http://security.ubuntu.com/ubuntu/ hardy-security universe
    deb-src http://security.ubuntu.com/ubuntu/ hardy-security universe
    deb http://security.ubuntu.com/ubuntu/ hardy-security multiverse
    deb-src http://security.ubuntu.com/ubuntu/ hardy-security multiverse
    
    ## MEDIBUNTU
    deb http://fr.packages.medibuntu.org/ hardy free non-free
    
    # Dépôts de sources (uniquement utiles pour télécharger les sources avec apt-get source. Dans ce cas enlever les #)
    # deb-src http://fr.packages.medibuntu.org/ hardy free non-free
    
    ## Dépôt de paquets en cours de tests -- décommentez les lignes
    ## pour en activer l'accès. Ceci devrait être réservé à des
    ## développeurs et des testeurs avancés.
    # deb http://fr.packages.medibuntu.org/ hardy-staging free non-free
    # deb-src http://fr.packages.medibuntu.org/ hardy-staging free non-free
    -1