Bonjour,

J'essaye de faire un test en Pro*C.
Je suis sur Win10, avec Cygwin et gcc.

Voici mon fichier de test , "exemple.pc" :

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
 
#include <stdio.h>
#include <string.h>
#include <sqlda.h>
#include <sqlcpr.h>
 
EXEC SQL BEGIN DECLARE SECTION;
VARCHAR uid[30];
VARCHAR pwd[30];
EXEC SQL END DECLARE SECTION;
 
EXEC SQL INCLUDE SQLCA.H;
 
void main()
{
   strcpy(uid.arr,"mon_user");
   uid.len =strlen(uid.arr);
   strcpy(pwd.arr,"mon_password");
   pwd.len = strlen(pwd.arr);
 
   EXEC SQL WHENEVER SQLERROR GOTO errexit;
   EXEC SQL CONNECT :uid IDENTIFIED BY :pwd;
 
   printf("Connected to Oracle...\n");
 
   EXEC SQL COMMIT WORK RELEASE;
   return;
 
errexit:
   printf("Connection failed");
   return;
 
}
La précompilation se passe bien :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
PROC C:\MesFichiersProc\exemple.pc
Mais la compilation :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
C:\cygwin64\bin\gcc -m64 "C:\MesFichiersProc\exemple.c" -o "C:\MesFichiersProc\Hello" -I"C:\app\oracle\product\11.2.0\client_1\BIN" -I"C:\app\oracle\product\11.2.0\client_1\precomp\public" -L"C:\app\oracle\product\11.2.0\client_1\precomp\LIB\orasql11.lib"

produit le message d'erreur suivant :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
 
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: /cygdrive/c/Users/qgdn9639/AppData/Local/Temp/ccXXuXls.o:exemple.pc.c:(.text+0x22d): undefined reference to `sqlcxt'
/cygdrive/c/Users/qgdn9639/AppData/Local/Temp/ccXXuXls.o:exemple.pc.c:(.text+0x22d): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `sqlcxt'
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: /cygdrive/c/Users/qgdn9639/AppData/Local/Temp/ccXXuXls.o:exemple.pc.c:(.text+0x2bf): undefined reference to `sqlcxt'
/cygdrive/c/Users/qgdn9639/AppData/Local/Temp/ccXXuXls.o:exemple.pc.c:(.text+0x2bf): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `sqlcxt'
collect2: error: ld returned 1 exit status
Quelqu'un aurait-il une idée ?
Ce problème me désespère...