Compiler un fichier de base en C sur fedora

jojo -  
lami20j Messages postés 21506 Date d'inscription   Statut Modérateur, Contributeur sécurité Dernière intervention   -
Bonjour,

je n'arrive plus à compiler un petit fichier test.c constitué d'un seul printf.
j'ai pourtant installer le gcc sur ma fedora et voilà ce que ça me retourne:

[membre_sacer@localhost noeud]$ gcc test -o test.c
test: In function `_start':
(.text+0x0): multiple definition of `_start'
/usr/lib/gcc/i386-redhat-linux/4.3.0/../../../crt1.o:(.text+0x0): first defined here
test:(.rodata+0x0): multiple definition of `_fp_hw'
/usr/lib/gcc/i386-redhat-linux/4.3.0/../../../crt1.o:(.rodata+0x0): first defined here
test: In function `_fini':
(.fini+0x0): multiple definition of `_fini'
/usr/lib/gcc/i386-redhat-linux/4.3.0/../../../crti.o:(.fini+0x0): first defined here
test:(.rodata+0x4): multiple definition of `_IO_stdin_used'
/usr/lib/gcc/i386-redhat-linux/4.3.0/../../../crt1.o:(.rodata.cst4+0x0): first defined here
test: In function `__data_start':
(.data+0x0): multiple definition of `__data_start'
/usr/lib/gcc/i386-redhat-linux/4.3.0/../../../crt1.o:(.data+0x0): first defined here
test:(.rodata+0x8): multiple definition of `__dso_handle'
/usr/lib/gcc/i386-redhat-linux/4.3.0/crtbegin.o:(.rodata+0x0): first defined here
test: In function `_init':
(.init+0x0): multiple definition of `_init'
/usr/lib/gcc/i386-redhat-linux/4.3.0/../../../crti.o:(.init+0x0): first defined here
/usr/lib/gcc/i386-redhat-linux/4.3.0/crtend.o:(.dtors+0x0): multiple definition of `__DTOR_END__'
test:(.dtors+0x4): first defined here
/usr/bin/ld: warning: Cannot create .eh_frame_hdr section, --eh-frame-hdr ignored.
/usr/bin/ld: error in test(.eh_frame); no .eh_frame_hdr table will be created.
collect2: ld returned 1 exit status

on ne sait jamais peut-être que qq à la solution.
Configuration: Linux Fedora
Firefox 3.0

4 réponses

  1. tatou_38 Messages postés 1220 Date d'inscription   Statut Membre Dernière intervention   121
     
    Montre ton programme, je crais le pire !
    0
    1. jojo
       
      il n' y a rien de compliquer.
      d'autant plus que hier ça marché très bien!!!!


      #include <stdio.h>
      #include <stdlib.h>

      int main(){

      printf("test \n");
      return 0;

      }
      0
  2. lami20j Messages postés 21506 Date d'inscription   Statut Modérateur, Contributeur sécurité Dernière intervention   3 571
     
    Salut,

    au début de ton fichier as-tu mis #include <stdio.h> ?
    si oui, alors je pense que le fichier n'existe pas
    en ce cas tu dois installer la libraire libc developpement (sous debian c'est libc6-dev)
    0
    1. jojo
       
      en fait pour dire vrai, il m'efface le fichier à chaque fois que je compile gcc test -o test.c .
      je dois remettre une copie dans mon dossier.

      je pense que la libc se trouve dans ce paquet:

      [root@localhost noeud]# yum install glibc
      Loaded plugins: refresh-packagekit
      Setting up Install Process
      Parsing package install arguments
      Package glibc-2.8-1.i686 already installed and latest version
      Nothing to do
      [root@localhost noeud]#
      0
  3. tatou_38 Messages postés 1220 Date d'inscription   Statut Membre Dernière intervention   121
     
    gcc test -o test.c

    -o test.c don ton compilo écrit le fichier objet dans ... test.c

    gcc test.c suffit !
    0
  4. lami20j Messages postés 21506 Date d'inscription   Statut Modérateur, Contributeur sécurité Dernière intervention   3 571
     
    Salut,

    gcc test.c suffit !

    Pour compléter tatou_38 ;-)
    en ce cas le fichier exécutable s'appelle a.out
    0