IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Autres éditeurs Discussion :

hello1.c:(.text+0x18): undefined reference to `fopen'


Sujet :

Autres éditeurs

  1. #1
    Membre du Club
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    233
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2006
    Messages : 233
    Points : 60
    Points
    60
    Par défaut hello1.c:(.text+0x18): undefined reference to `fopen'
    en essayant de compiler mon programme, j'ai le message d'erreur suiavnt:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
     
    hello1.o: In function `Hello':
    hello1.c:(.text+0x18): undefined reference to `fopen'
    hello1.c:(.text+0x24): undefined reference to `OS_ScrInit'
    hello1.c:(.text+0x2c): undefined reference to `puts'
    hello1.c:(.text+0x3c): undefined reference to `fclose'
    ecran.o: In function `_start':
    ecran.c:(.text+0x18): undefined reference to `printf'
    ecran.c:(.text+0x30): undefined reference to `GetScreenSize'
    make: *** [hello1] Error 1
    sachant que j'ai bien inclue le fichier .h qui contient le prototype de ces fonctions,
    qq1 peut me dire de quoi sagit ces .text+0x18

    merci

  2. #2
    Membre éclairé Avatar de MatRem
    Profil pro
    Inscrit en
    Décembre 2002
    Messages
    750
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2002
    Messages : 750
    Points : 693
    Points
    693
    Par défaut
    Quel est ton système, comment compiles tu?

  3. #3
    Membre du Club
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    233
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2006
    Messages : 233
    Points : 60
    Points
    60
    Par défaut
    j'utilise GCC_3.4.3 sous windows, mon makefile est :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
     
     
    CFLAGS=-Wall
    #CHC - 
    #CFLAGS=-Wall -ansi
    #LDFLAGS=-Wall -ansi
     
     
    SDK_INC    = D:\SDK\inc
    SDK_LIB    = D:\SDK\lib_gnu
     
    GNU_VERSION = 3.4.3
     
    GNU_DIR      = C:\GCC_$(GNU_VERSION)
    GNU_BIN_DIR  = $(GNU_DIR)\bin
     
    GNU_TARGET   = arm-elf
    GNU_LIB_TYPE = thumb/soft/interwork
     
    GNU_LIB_DIR_1 = $(GNU_DIR)\$(GNU_TARGET)\lib\$(GNU_LIB_TYPE)
    GNU_LIB_DIR_2 = $(GNU_DIR)\lib\gcc\$(GNU_TARGET)\$(GNU_VERSION)\$(GNU_LIB_TYPE)
     
    #CCOPT      = -Os -Wall -Wcast-align -mthumb -mthumb-interwork -mlittle-endian -msoft-float -pipe -mcpu=arm920t -fomit-frame-pointer -fshort-enums -mstructure-size-boundary=8 -g -c
    INCLUDES   = -I $(SDK_INC)
     
    GNU_LINKER = $(GNU_BIN_DIR)\$(GNU_TARGET)-ld
    GNU_COMPILER = $(GNU_BIN_DIR)\$(GNU_TARGET)-gcc $(INCLUDES)
     
    #LDFLAGS= "$(GNU_LIB_DIR_1)"  -L "$(GNU_LIB_DIR_2)" -lc -lgcc 
     
     
     
    LIBS       ="$(SDK_LIB)\eft30.lib" "$(SDK_LIB)\pinlib.lib" -L "$(GNU_LIB_DIR_1)" -lc -L "$(GNU_LIB_DIR_2)" -lgcc
    #LIBS       = -L "$(SDK_LIB)"
     
    EXEC=hello1
     
    all: $(EXEC)
     
    hello1: hello1.o ecran.o
    	$(GNU_LINKER) $(LIBS) -o hello1 hello1.o ecran.o  $(INCLUDES) 
    	#$(LDFLAGS)
     
    hello1.o: hello1.c
    	$(GNU_COMPILER)  $(CFLAGS) -o hello1.o -c hello1.c  
     
    ecran.o: ecran.c hello1.h
    	$(GNU_COMPILER)  $(CFLAGS) -o ecran.o -c ecran.c   
    .PHONY: clean mrproper
     
    clean:
    	rm -rf *.o
     
    mrproper: clean
    	rm -rf $(EXEC)*
    et le message d'erreur est:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
     
    C:\DOCUME~1\abdel\LOCALS~1\Temp\make9762.sh: C:GCC_3.4.3binarm-elf-ld: command not found
    make: *** [hello1] Error 127
    on dirai qu'il recoonai pas les '\'

  4. #4
    Membre du Club
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    233
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2006
    Messages : 233
    Points : 60
    Points
    60
    Par défaut
    cbon, mon makefile marche bien, je pense que mon problème était dans le chemin des Libs

    Merci pour tous

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. winsock.h : undefined reference...
    Par abraxas dans le forum Dev-C++
    Réponses: 14
    Dernier message: 06/08/2012, 13h42
  2. Réponses: 2
    Dernier message: 21/08/2011, 12h25
  3. Réponses: 8
    Dernier message: 22/07/2008, 14h30
  4. Réponses: 9
    Dernier message: 12/06/2006, 14h01
  5. g++ : undefined reference to ...
    Par le_barbu dans le forum Autres éditeurs
    Réponses: 16
    Dernier message: 14/05/2004, 07h23

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo