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

Linux Discussion :

probleme avec makefile


Sujet :

Linux

  1. #1
    Futur Membre du Club
    Inscrit en
    Mars 2009
    Messages
    7
    Détails du profil
    Informations forums :
    Inscription : Mars 2009
    Messages : 7
    Points : 5
    Points
    5
    Par défaut probleme avec makefile
    salut a tous, j'ai un petit soucis avec un makefile:
    en fait j'essaye de compiler un petit program utilisant une lib (obexftp) installée dans un dossier non standard (~/bidon).

    j'ai essayé quelques trucs, mais ca ne compile pas, voici le makefile et les erreurs:

    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
    OBEXFTPINC=-I/home/ayman/bidon/usr/local/include -I/opt/STM/STLinux-2.3/devkit/sh4/target/usr/include
    OBEXFTPLIB=-L/home/ayman/bidon/usr/local/lib -lobexftp -L/opt/STM/STLinux-2.3/devkit/sh4/target/usr/lib -lopenobex -lbluetooth
     
    OBEXINC=-I/opt/STM/STLinux-2.3/devkit/sh4/target/usr/include
    OBEXLIB=-L/opt/STM/STLinux-2.3/devkit/sh4/target/usr/lib -lopenobex -lbluetooth
     
    CFLAGS:=${CFLAGS} -Wall
    all: c_example_obex_push
     
    c_example_obex_push: c_example_obex_push.o
        sh4-linux-gcc c_example_obex_push.o ${OBEXFTPLIB}  -o c_example_obex_push
     
    c_example_obex_push.o: c_example_obex_push.c
        sh4-linux-gcc ${CFLAGS} ${OBEXFTPINC}  -c c_example_obex_push.c -o c_example_obex_push.o
     
     
    clean:
        @rm -rf c_example_obex_push *.o *~

    et l'erreur:

    sh4-linux-gcc c_example_obex_push.o -L/home/ayman/bidon/usr/local/lib -lobexftp -L/opt/STM/STLinux-2.3/devkit/sh4/target/usr/lib -lopenobex -lbluetooth -o c_example_obex_push
    /opt/STM/STLinux-2.3/devkit/sh4/lib/gcc/sh4-linux/4.2.4/../../../../sh4-linux/bin/ld: warning: libmulticobex.so.1, needed by /home/ayman/bidon/usr/local/lib/libobexftp.so, not found (try using -rpath or -rpath-link)
    /opt/STM/STLinux-2.3/devkit/sh4/lib/gcc/sh4-linux/4.2.4/../../../../sh4-linux/bin/ld: warning: libbfb.so.0, needed by /home/ayman/bidon/usr/local/lib/libobexftp.so, not found (try using -rpath or -rpath-link)
    /home/ayman/bidon/usr/local/lib/libobexftp.so: undefined reference to `cobex_ctrans'
    collect2: ld returned 1 exit status
    make: *** [c_example_obex_push] Error 1

  2. #2
    Futur Membre du Club
    Inscrit en
    Mars 2009
    Messages
    7
    Détails du profil
    Informations forums :
    Inscription : Mars 2009
    Messages : 7
    Points : 5
    Points
    5
    Par défaut
    finalement j'ai reussi a le compiler voila le nouveau makefile:

    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
    OBEXINC=-I/opt/STM/STLinux-2.3/devkit/sh4/target/usr/include
    OBEXLIB=-L/opt/STM/STLinux-2.3/devkit/sh4/target/usr/lib -lopenobex -lbluetooth
     
     
    CFLAGS:=${CFLAGS} -Wall -I/home/ayman/bidon/usr/local/include/
    LIBS:=-L/home/ayman/bidon/usr/local/lib -lobexftp -lbfb -lmulticobex
    all: c_example_obex_push 
     
    c_example_obex_push: c_example_obex_push.o 
    	sh4-linux-gcc c_example_obex_push.o ${OBEXLIB} ${LIBS} -o c_example_obex_push
     
    c_example_obex_push.o: c_example_obex_push.c 
    	sh4-linux-gcc ${CFLAGS} ${OBEXINC}  -c c_example_obex_push.c -o c_example_obex_push.o
     
     
    clean:
    	@rm -rf c_example_obex_push *.o *~

    mais l'executable ne s'execute pas sur la cible...
    j'ai une erreure du type:
    error while loading shared libraries: libobexftp.so.0: cannot open shared object file: No such file or di
    rectory

  3. #3
    Responsable 2D/3D/Jeux


    Avatar de LittleWhite
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Mai 2008
    Messages
    26 894
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Mai 2008
    Messages : 26 894
    Points : 219 537
    Points
    219 537
    Billets dans le blog
    124
    Par défaut
    Bonjour,

    Pour la dernière erreur, il faut ( possibilité ) placer le fichier qu'il ne trouve pas dans /usr/lib/
    Ou dans un répertoire dans lequel il a l'habitude de chercher.

  4. #4
    Membre averti
    Inscrit en
    Septembre 2006
    Messages
    414
    Détails du profil
    Informations forums :
    Inscription : Septembre 2006
    Messages : 414
    Points : 354
    Points
    354
    Par défaut
    non, je travail sur un server de compil, je n'ai pas tous les droits dessus...

    mais finalement j'ai trouvé, il suffisait d'inclure les lib qu'il manquait (macro LIBS dans le code qui suit)

    je pensais que la libobexftp suffisait, mais il fallait aussi rajouter libmulticobex et libbfb

    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
    OBEXINC=-I/opt/STM/STLinux-2.3/devkit/sh4/target/usr/include
    OBEXLIB=-L/opt/STM/STLinux-2.3/devkit/sh4/target/usr/lib -lopenobex -lbluetooth
     
     
    CFLAGS:=${CFLAGS} -Wall -I/home/ayman/bidon/usr/local/include/
    LIBS:=-L/home/ayman/bidon/usr/local/lib -lobexftp -lmulticobex -lbfb
    all: test
     
    test: test.o
      sh4-linux-gcc test.o ${OBEXLIB} ${LIBS}  -o test
     
    test.o: test.c
      sh4-linux-gcc ${CFLAGS} ${OBEXINC}  -c test.c -o test.o
     
     
    clean:
      @rm -rf test *.o *~
    en rajoutant LIBS:=-L/home/ayman/bidon/usr/local/lib -lobexftp -lmulticobex -lbfb

    ca a resolu le probleme.

    par contre a l'execution (sur la target) il ne trouve pas les bonnes lib,

    la j'ai du deplacer la lib vers /usr/lib/
    mais je voulais savoir...existe il une macro du genre $PATH a laquelle je pourrai rajouter mon ~/bidon/lib histoire de...


    merci

Discussions similaires

  1. Probleme avec Makefile
    Par mzutg dans le forum Systèmes de compilation
    Réponses: 4
    Dernier message: 02/03/2015, 00h22
  2. Probleme avec makefile
    Par asma.r dans le forum Applications et environnements graphiques
    Réponses: 2
    Dernier message: 19/10/2009, 11h26
  3. Probleme de compilation avec Makefile et Oracle V10
    Par miketidy dans le forum Linux
    Réponses: 2
    Dernier message: 10/09/2008, 09h48
  4. [débutant]probleme avec makefile-module objet non créé
    Par Invité dans le forum Systèmes de compilation
    Réponses: 5
    Dernier message: 13/06/2007, 18h22
  5. Problème avec un Makefile
    Par _kal_ dans le forum Linux
    Réponses: 1
    Dernier message: 03/08/2006, 19h12

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