OCILIB looks great! I am new to both C and OCILIB but not new to programming (Clipper\xHarbour, VB 3-6, PHP etc.).
I am trying to get the most basic code example working. I am trying link and compile using TDM-GCC 4.8. I seem to be able to compile it OK but every time I run the program it crashes (Exception code: c0000005). It crashes at the point of calling OCI_Initialize().
Environment
* Windows 7 64-bit (running in a Oracle VirtualBox (AKA VM) hosted on a Windows 2008 R2 64-bit server.
* Oracle: Oracle 11g R2 (64)
* GCC: Version 4.8.1
* Command line (tried MANY variations): gcc -Wall -o oratest.exe oratext.c -LC:\ocilib\ocilib64 -lociliba -DOC_CHARSET_ANSI -DOC_API=__stdcall
* Simple C programs compile and run OK: hello world (hello.c) etc.. Both console and Windows simple programs that is.
I have scoured the web looking for a solution without success.
As we discussed by email, there is an issue with 64bit application generated by TDM-GCC that cannot load symbol from the 64bit OCILIB DLL generated by MS Compiler.
It works fine with 32bit application generated with TDM-GCC.
The isssue is only on Windows platform and under investigation.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
is there always the issue on Windows 64 library.
I am using OCILIB (ocilib-4.1.0-windows) with MYSYS.
It is working fine with 32bit version.
When I try to compile with 64bit version (and pointing on the 64 lib version provided in ocilib-4.2.0-windows.zip), I get the following error on each call of OCI function
...ocilib/lib64/ociliba.lib(ociliba.dll.b):(.text+0x2): relocation truncated to fit: R_X86_64_32 against symbol `__imp_OCI_ConnectionFree' defined in .idata$5 section in ../ocilib/lib64/ociliba.lib(ociliba.dll.b)
After research on internet, I add the parameter -mcmodel=medium to gcc line without success.
I am using the follwoing gcc parameter:
-g -m64 -std=c99 -mcmodel=medium -I. pkg-config --cflags libxml-2.0pkg-config --cflags gtk+-3.0 -IC:/ocilib/include
Option of the gcc link:
-g pkg-config --libs libxml-2.0pkg-config --libs gtk+-3.0 -LC:/ocilib/lib64 -lociliba
Hello,
OCILIB looks great! I am new to both C and OCILIB but not new to programming (Clipper\xHarbour, VB 3-6, PHP etc.).
I am trying to get the most basic code example working. I am trying link and compile using TDM-GCC 4.8. I seem to be able to compile it OK but every time I run the program it crashes (Exception code: c0000005). It crashes at the point of calling OCI_Initialize().
Trying example program on your docs site (with my database values for database, user and password)): http://orclib.sourceforge.net/documentation/
Environment
* Windows 7 64-bit (running in a Oracle VirtualBox (AKA VM) hosted on a Windows 2008 R2 64-bit server.
* Oracle: Oracle 11g R2 (64)
* GCC: Version 4.8.1
* Command line (tried MANY variations): gcc -Wall -o oratest.exe oratext.c -LC:\ocilib\ocilib64 -lociliba -DOC_CHARSET_ANSI -DOC_API=__stdcall
* Simple C programs compile and run OK: hello world (hello.c) etc.. Both console and Windows simple programs that is.
I have scoured the web looking for a solution without success.
What can you recommend?
Michael
As we discussed by email, there is an issue with 64bit application generated by TDM-GCC that cannot load symbol from the 64bit OCILIB DLL generated by MS Compiler.
It works fine with 32bit application generated with TDM-GCC.
The isssue is only on Windows platform and under investigation.
is there always the issue on Windows 64 library.
I am using OCILIB (ocilib-4.1.0-windows) with MYSYS.
It is working fine with 32bit version.
When I try to compile with 64bit version (and pointing on the 64 lib version provided in ocilib-4.2.0-windows.zip), I get the following error on each call of OCI function
...ocilib/lib64/ociliba.lib(ociliba.dll.b):(.text+0x2): relocation truncated to fit: R_X86_64_32 against symbol `__imp_OCI_ConnectionFree' defined in .idata$5 section in ../ocilib/lib64/ociliba.lib(ociliba.dll.b)
After research on internet, I add the parameter -mcmodel=medium to gcc line without success.
I am using the follwoing gcc parameter:
-g -m64 -std=c99 -mcmodel=medium -I.
pkg-config --cflags libxml-2.0pkg-config --cflags gtk+-3.0-IC:/ocilib/includeOption of the gcc link:
-g
pkg-config --libs libxml-2.0pkg-config --libs gtk+-3.0-LC:/ocilib/lib64 -locilibaVersion of gcc used:
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-msys/4.9.2/lto-wrapper.exe
Target: x86_64-pc-msys
Configured with: /msys_scripts/gcc/src/gcc-4.9.2/configure --build=x86_64-pc-msys --prefix=/usr --libexecdir=/usr/lib --enable-bootstrap --enable-shared --enable-shared-libgcc --enable-static --enable-version-specific-runtime-libs --with-arch=x86-64 --disable-multilib --with-tune=generic --enable-__cxa_atexit --with-dwarf2 --enable-languages=c,c++,fortran,lto --enable-graphite --enable-threads=posix --enable-libatomic --enable-libgomp --disable-libitm --enable-libquadmath --enable-libquadmath-support --enable-libssp --disable-win32-registry --disable-symvers --with-gnu-ld --with-gnu-as --disable-isl-version-check --enable-checking=release --without-libiconv-prefix --without-libintl-prefix --with-system-zlibThread model: posix
gcc version 4.9.2 (GCC)
Is it an known issue on Windows 64 bit version?
Regards