• [^] # Re: ./Source/Lib.o

    Posté par . En réponse au message compilation d'une librairie .so recalcitrante. Évalué à 1.

    Bonjour , merci de vos réponses.

    Donc quand je compille en 32bit, eclipse me fait:Building target: libLib.so
    Invoking: GCC C++ Linker
    g++ -m32 -shared -o"libLib.so" ./Source/Lib.o -lGLEW -lglut
    /usr/bin/ld: skipping incompatible /usr/bin/../lib/libGLEW.so when searching for -lGLEW
    /usr/bin/ld: skipping incompatible /usr/bin/../lib/libGLEW.a when searching for -lGLEW
    /usr/bin/ld: skipping incompatible /usr/lib/libGLEW.so when searching for -lGLEW
    /usr/bin/ld: skipping incompatible /usr/lib/libGLEW.a when searching for -lGLEW
    /usr/bin/ld: cannot find -lGLEW
    collect2: ld a retourné 1 code d'état d'exécution
    make: *** [libLib.so] Erreur 1
    make: La cible « all » n'a pas pu être refabriquée à cause d'erreurs.
    Build complete for project Lib


    quand je compille en 64bit , j'ai :
    **** Build of configuration Debug for project Lib ****

    make -k all
    Building target: libLib.so
    Invoking: GCC C++ Linker
    g++ -m64 -shared -o"libLib.so" ./Source/Lib.o -lGLEW -lglut
    /usr/bin/ld: ./Source/Lib.o: relocation R_X86_64_32S against `x1a0' can not be used when making a shared object; recompile with -fPIC
    ./Source/Lib.o: could not read symbols: Bad value
    collect2: ld a retourné 1 code d'état d'exécution
    make: *** [libLib.so] Erreur 1
    make: La cible « all » n'a pas pu être refabriquée à cause d'erreurs.
    Build complete for project Lib


    donc je rajoute l'option -fPIC : **** Build of configuration Debug for project Lib ****

    make -k all
    Building target: libLib.so
    Invoking: GCC C++ Linker
    g++ -m64 -fPIC -shared -o"libLib.so" ./Source/Lib.o -lGLEW -lglut
    /usr/bin/ld: ./Source/Lib.o: relocation R_X86_64_32S against `x1a0' can not be used when making a shared object; recompile with -fPIC
    ./Source/Lib.o: could not read symbols: Bad value
    collect2: ld a retourné 1 code d'état d'exécution
    make: *** [libLib.so] Erreur 1
    make: La cible « all » n'a pas pu être refabriquée à cause d'erreurs.
    Build complete for project Lib


    peut être ça peut aidé , les includes de mon code :
    #include <stdio.h>
    #include <libio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <math.h>


    #include <time.h>
    #include <sys/timeb.h>

    #include <GL/glew.h>
    #include <GL/glut.h>
    #include <GL/glx.h>

    #ifdef ACML
    #include </opt/acml4.0.1/gfortran64_mp_int64/include/acml.h>
    //#include </opt/acml3.6.1/gfortran64_mp/include/acml.h> //3.6 en 64 multiproc
    #endif



    #include <sys/types.h>
    #include <sys/stat.h>
    #include <unistd.h>


    je ne défini pas ACML