Witam,
Chcę napisać w C aplikacje kliencką do bazy danych w Oracle.
Od jakiegoś czasu męczę się w DEV-C++ z biblioteką "ocilib" która umożliwia połączenie z bazą danych w Oraclu. Problem polega na tym, że gdy próbuję skompilować poniższy program:
#include <ocilib.h>
#define OCI_API_to __stdcall
#define OCI_CHARSET_MIXED
int main(void)
{
OCI_Connection *cn;
if (!OCI_Initialize(NULL, NULL, OCI_ENV_DEFAULT))
return EXIT_FAILURE;
cn = OCI_ConnectionCreate("tesjet", "tesjet", "tesjet1", OCI_SESSION_DEFAULT);
printf("Server major version : %i\n", OCI_GetServerMajorVersion(cn));
printf("Server minor version : %i\n", OCI_GetServerMinorVersion(cn));
printf("Server revision version : %i\n\n", OCI_GetServerRevisionVersion(cn));
printf("Connection version : %i\n\n", OCI_GetVersionConnection(cn));
OCI_Cleanup();
return EXIT_SUCCESS;
}
DEV-C++ zwraca mi taką oto informację:
Kompilator: MinGW GCC 4.7.0 32-bit
Building Makefile "C:\Users\tesjet\Documents\Klient ORACLE\Makefile.win"
Wykonywanie make...
mingw32-make.exe -f "C:\Users\tesjet\Documents\Klient ORACLE\Makefile.win" all
gcc.exe main.o -o oracle.exe -L"C:/Program Files (x86)/Dev-Cpp/MinGW32/lib" -static-libstdc++ -static-libgcc -locilibm libocilibm.lib libocilibm.a
main.o:main.c:(.text+0x26): undefined reference to `_OCI_Initialize'
main.o:main.c:(.text+0x58): undefined reference to `_OCI_ConnectionCreate'
main.o:main.c:(.text+0x68): undefined reference to `_OCI_GetServerMajorVersion'
main.o:main.c:(.text+0x84): undefined reference to `_OCI_GetServerMinorVersion'
main.o:main.c:(.text+0xa0): undefined reference to `_OCI_GetServerRevisionVersion'
main.o:main.c:(.text+0xbc): undefined reference to `_OCI_GetVersionConnection'
main.o:main.c:(.text+0xd1): undefined reference to `_OCI_Cleanup'
collect2.exe: error: ld returned 1 exit status
C:\Users\tesjet\Documents\Klient ORACLE\Makefile.win:26: recipe for target 'oracle.exe' failed
mingw32-make.exe: *** [oracle.exe] Error 1
Wykonanie zakończone
Bardzo byłbym wdzięczny jeżeli ktoś podpowiedziałby co należy zrobić aby ten program został poprawnie skompilowany.