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

Interfaces de programmation Oracle Discussion :

[OCILIB] Instalation pour connexion Oracle


Sujet :

Interfaces de programmation Oracle

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Futur Membre du Club
    Profil pro
    Inscrit en
    Mars 2008
    Messages
    4
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2008
    Messages : 4
    Par défaut [OCILIB] Instalation pour connexion Oracle
    Bonjour,

    Je souhaiterai installer ocilib pour me connecter à ma base oracle.

    Cependant, dès le ./configure j'ai des erreurs.
    Il doit y avoir un souci au niveau des variables d’environnement.

    version ocilib : 3.9.0
    version client oracle : 11.2
    version serveur oracle : 11g
    OS de la machine : Fedora14 / 32 bit

    Ci dessous le log du ./configure ainsi que les valeurs des variables d’environnements nécessaire.

    Log : ./configure
    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
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
     
    [root@enregistrement ocilib-3.9.0]# ./configure
    checking for a BSD-compatible install... /usr/bin/install -c
    checking whether build environment is sane... yes
    checking for a thread-safe mkdir -p... /bin/mkdir -p
    checking for gawk... gawk
    checking whether make sets $(MAKE)... yes
    checking for gcc... gcc
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables...
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether gcc accepts -g... yes
    checking for gcc option to accept ISO C89... none needed
    checking for style of include used by make... GNU
    checking dependency style of gcc... gcc3
    checking build system type... i686-pc-linux-gnu
    checking host system type... i686-pc-linux-gnu
    checking for a sed that does not truncate output... /bin/sed
    checking for grep that handles long lines and -e... /bin/grep
    checking for egrep... /bin/grep -E
    checking for ld used by gcc... /usr/bin/ld
    checking if the linker (/usr/bin/ld) is GNU ld... yes
    checking for /usr/bin/ld option to reload object files... -r
    checking for BSD-compatible nm... /usr/bin/nm -B
    checking whether ln -s works... yes
    checking how to recognize dependent libraries... pass_all
    checking how to run the C preprocessor... gcc -E
    checking for ANSI C header files... yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    checking dlfcn.h usability... yes
    checking dlfcn.h presence... yes
    checking for dlfcn.h... yes
    checking for g++... g++
    checking whether we are using the GNU C++ compiler... yes
    checking whether g++ accepts -g... yes
    checking dependency style of g++... gcc3
    checking how to run the C++ preprocessor... g++ -E
    checking for g77... no
    checking for xlf... no
    checking for f77... no
    checking for frt... no
    checking for pgf77... no
    checking for cf77... no
    checking for fort77... no
    checking for fl32... no
    checking for af77... no
    checking for xlf90... no
    checking for f90... no
    checking for pgf90... no
    checking for pghpf... no
    checking for epcf90... no
    checking for gfortran... gfortran
    checking whether we are using the GNU Fortran 77 compiler... yes
    checking whether gfortran accepts -g... yes
    checking the maximum length of command line arguments... 1572864
    checking command to parse /usr/bin/nm -B output from gcc object... ok
    checking for objdir... .libs
    checking for ar... ar
    checking for ranlib... ranlib
    checking for strip... strip
    checking if gcc supports -fno-rtti -fno-exceptions... no
    checking for gcc option to produce PIC... -fPIC
    checking if gcc PIC flag -fPIC works... yes
    checking if gcc static flag -static works... no
    checking if gcc supports -c -o file.o... yes
    checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
    checking whether -lc should be explicitly linked in... no
    checking dynamic linker characteristics... GNU/Linux ld.so
    checking how to hardcode library paths into programs... immediate
    checking whether stripping libraries is possible... yes
    checking if libtool supports shared libraries... yes
    checking whether to build shared libraries... yes
    checking whether to build static libraries... yes
    configure: creating libtool
    appending configuration tag "CXX" to libtool
    checking for ld used by g++... /usr/bin/ld
    checking if the linker (/usr/bin/ld) is GNU ld... yes
    checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
    checking for g++ option to produce PIC... -fPIC
    checking if g++ PIC flag -fPIC works... yes
    checking if g++ static flag -static works... no
    checking if g++ supports -c -o file.o... yes
    checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
    checking dynamic linker characteristics... GNU/Linux ld.so
    checking how to hardcode library paths into programs... immediate
    appending configuration tag "F77" to libtool
    checking if libtool supports shared libraries... yes
    checking whether to build shared libraries... yes
    checking whether to build static libraries... yes
    checking for gfortran option to produce PIC... -fPIC
    checking if gfortran PIC flag -fPIC works... yes
    checking if gfortran static flag -static works... no
    checking if gfortran supports -c -o file.o... yes
    checking whether the gfortran linker (/usr/bin/ld) supports shared libraries... yes
    checking dynamic linker characteristics... GNU/Linux ld.so
    checking how to hardcode library paths into programs... immediate
    checking for ranlib... (cached) ranlib
    checking for OCILIB install path... /usr/local
    checking for OCILIB version... v3.9.0
    checking for OCILIB options... import: linkage, charset = ansi
    checking for Oracle home... defined by environment : /usr/lib/oracle/11.2/client
    checking for Oracle OCI headers location... configure: error: variable not set or unable to guess
    [root@enregistrement ocilib-3.9.0]#
    Variables d’environnements :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
     
    [root@enregistrement ocilib-3.9.0]# echo $ORACLE_HOME
    /usr/lib/oracle/11.2/client
     
    [root@enregistrement ocilib-3.9.0]# echo $LD_LIBRARY_PATH
    /usr/lib/oracle/11.2/client/lib:/usr/include/oracle/11.2/client


    J'ajouterai que j'ai essayé de lancer le ./configure avec l'argument :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    ./configure --with-oracle-headers-path=$ORACLE_HOME
    Ce qui résolvais le problème, mais par la suite un erreur survenais au niveau du make :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
     
    In file included from ocilib_defs.h:39:0,
                     from ocilib_types.h:38,
                     from ocilib_internal.h:38,
                     from array.c:35:
    oci_import.h:48:19: fatal error: oci.h: No such file or directory
    Si vous avez besoin d'autres informations, faite le moi savoir.
    Merci.
    Alexandre

  2. #2
    Rédacteur
    Avatar de Vincent Rogier
    Profil pro
    Inscrit en
    Juillet 2007
    Messages
    2 373
    Détails du profil
    Informations personnelles :
    Âge : 47
    Localisation : France

    Informations forums :
    Inscription : Juillet 2007
    Messages : 2 373
    Par défaut
    salut,

    le configure ne trouve pas les headers de OCI...

    Ils sont usuellement dans ORACLE_HOME/rdbms/public ou ORACLE_HOME/rdbms/demo

    Cherches le répertoire qui contient oci.h et si c'est pas l'un des deux cités, il faut alors passer au configure l'option --with-oracle-headers-path avec le répertoire qui contient oci.h
    Vincent Rogier.

    Rubrique ORACLE : Accueil - Forum - Tutoriels - FAQ - Livres - Blog

    Vous voulez contribuer à la rubrique Oracle ? Contactez la rubrique !

    OCILIB (C Driver for Oracle)

    Librairie C Open Source multi-plateformes pour accéder et manipuler des bases de données Oracle

  3. #3
    Futur Membre du Club
    Profil pro
    Inscrit en
    Mars 2008
    Messages
    4
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2008
    Messages : 4
    Par défaut
    Bonjour,

    D'abord, merci d'avoir répondu aussi vite.
    Effectivement, avec ce paramètre le ./configure c'est lancé correctement, et j'ai pu effectuer le make et le make install.
    Les .h d'OCI était dans /usr/include/oracle/11.2/client/

    Cependant, je ne parviens pas à compiler un petit bout de code pour initialiser la connexion à Oracle...

    Saurais tu d’où viens le problème ?
    Y aurai t'il eu un souci a la compilation d'ocilib ?
    Ou tout simplement un linker manquant ? (j'avoue que je suis un peu perdu dans toute cette histoire, surtout que je n'ai pas la possibilité de mettre un environnement de dev (ssh oblige )

    g++ main.cpp :
    Code c++ : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    [root@enregistrement oracle]# g++ main.cpp
    /tmp/ccLqL2cj.o: In function `main':
    main.cpp:(.text+0x21): undefined reference to `OCI_Initialize'
    main.cpp:(.text+0x69): undefined reference to `OCI_ConnectionCreate'
    main.cpp:(.text+0x72): undefined reference to `OCI_Cleanup'
    collect2: ld a retourné 1 code d'état d'exécution

    Contenue du main.cpp :
    Code c++ : 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
    #include <iostream>
    #include <ocilib.h>
     
    using namespace std;
     
    int main()
    {
        OCI_Connection *cn;
     
        if (!OCI_Initialize(NULL, NULL, OCI_ENV_DEFAULT)) {
            cout << "Erreur d'initaialisation";
            return 1;
        }
        cn = OCI_ConnectionCreate("db", "usr", "pwd", OCI_SESSION_DEFAULT);
     
     
        OCI_Cleanup();
     
        return 0;
    }

    Merci.
    Alexandre.

  4. #4
    Rédacteur
    Avatar de Vincent Rogier
    Profil pro
    Inscrit en
    Juillet 2007
    Messages
    2 373
    Détails du profil
    Informations personnelles :
    Âge : 47
    Localisation : France

    Informations forums :
    Inscription : Juillet 2007
    Messages : 2 373
    Par défaut
    Salut,

    le linker n'as pu résoudre les symboles.


    Il faut rajouter :

    -L/$ORACLE_HOME/lib -locilib

    lors de l'édition des liens.
    Vincent Rogier.

    Rubrique ORACLE : Accueil - Forum - Tutoriels - FAQ - Livres - Blog

    Vous voulez contribuer à la rubrique Oracle ? Contactez la rubrique !

    OCILIB (C Driver for Oracle)

    Librairie C Open Source multi-plateformes pour accéder et manipuler des bases de données Oracle

  5. #5
    Futur Membre du Club
    Profil pro
    Inscrit en
    Mars 2008
    Messages
    4
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2008
    Messages : 4
    Par défaut
    Merci beaucoup ça fonctionne.
    Le reste devrait aller tout seul maintenant.


    Pour info, voici comment j'ai écris le Makefile :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
     
    main: main.cpp
            g++ main.cpp -o main -lm -L/$ORACLE_HOME/lib -locilib
     
    clean:
            rm -f main
            rm -f *.o
    Cordialement,
    Alexandre

  6. #6
    Rédacteur
    Avatar de Vincent Rogier
    Profil pro
    Inscrit en
    Juillet 2007
    Messages
    2 373
    Détails du profil
    Informations personnelles :
    Âge : 47
    Localisation : France

    Informations forums :
    Inscription : Juillet 2007
    Messages : 2 373
    Par défaut
    you're welcome
    Vincent Rogier.

    Rubrique ORACLE : Accueil - Forum - Tutoriels - FAQ - Livres - Blog

    Vous voulez contribuer à la rubrique Oracle ? Contactez la rubrique !

    OCILIB (C Driver for Oracle)

    Librairie C Open Source multi-plateformes pour accéder et manipuler des bases de données Oracle

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

Discussions similaires

  1. Problème pour installer le driver Oracle
    Par lpnkng dans le forum iReport
    Réponses: 3
    Dernier message: 26/03/2009, 10h04
  2. [Débutant] Pré installation pour une connections oracle avec C#
    Par bilred dans le forum Accès aux données
    Réponses: 2
    Dernier message: 04/11/2008, 16h49
  3. installation d'un filtre maître pour connexion Internet
    Par new_wave dans le forum Dépannage et Assistance
    Réponses: 3
    Dernier message: 04/09/2008, 10h58
  4. [Oracle] installer le module Oracle pour PHP
    Par Longrais dans le forum PHP & Base de données
    Réponses: 2
    Dernier message: 04/12/2007, 17h14
  5. Réponses: 6
    Dernier message: 28/10/2004, 08h18

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