Menu

oci.lib 32bits | 64 bits

2012-04-02
2017-04-30
  • Josemi Antelo

    Josemi Antelo - 2012-04-02

    Hello!

    I want my program to run both 32bit and 64bit. So I guess I must to have
    different oci.lib and oci.dll: oci32.lib, oci32.dll, oci64.lib and oci64.dll.
    Where I can get oci32.lib,oci64.lib,oci32.dll,oci64.dll for Oracle 11g?.
    I have seen it usually specifies the type of library in "oci_import.h" right?

    thank you very much
    attentively
    Josemi

     
  • Vincent Rogier

    Vincent Rogier - 2012-04-02

    Hi,

    a 32bit process can only load 32bits libraries and a 64 bits process 64bits
    libraries.
    In order to load 32 or 64bits libraries, you must create 2 versions of your
    applications.
    On windows, oracle libraries has the same name oci.dll whatever the version
    (32 or 64bits)
    You don't have to do any thing special regarding ocilib. You have to link each
    version of your application with the right ocilib version (32bits =>
    ocilib/lib32/ocilib.lib, 64bits => ocilib/lib64/ocilib.lib)
    then, ocilib will load the client at runtime that is accessible to it using
    the regular window rules (path environment) whatever its version.

    Hope it helps.

    vincent

     
  • Josemi Antelo

    Josemi Antelo - 2012-04-02

    Hi Vincent,

    First Off, many thanks for your rapid answer :-)
    But I don't use ocilib.lib. I compile your source code with my source code.
    Where do you specify the import library? I can't understand how the compiler
    know what library must to import.
    Until now, I compiled my project with your source code without specify what
    library to use, and Visual Studio 2005 has compiled fine (32bits) but now with
    64 bits, not.

    Yours sincerely
    Josemi

     
  • Vincent Rogier

    Vincent Rogier - 2012-04-02

    check :

    • \proj\dll\ solution (project used to compile ocilib library binaires of each release)
    • \proj\dll\demo project files
     
  • Josemi Antelo

    Josemi Antelo - 2012-04-03

    Hi Vincent,

    Under proj I've got:
    dll. There isn't any project with "solution" name
    mingw. There is only "ocilib_static_lib_mingw.cbp". I don't know what is it
    test. There are some project for VS2005, VS2008 and VS2010

    I compile dll\ocilib_dll_vs2005.sln and OK.
    But my question is where do you define the import "oci.lib". My intention is
    to have two oci.lib: oci32.lib and oci64.lib to create two projects: 32bits
    and 64bits. but How or where can I define what library to import?
    I tried to find where do you define the library to import and not found it.

    Many thanks for your patience :-)

    Yours sincerely
    Josemi

     
  • Vincent Rogier

    Vincent Rogier - 2012-04-03

    hi,

    On windows, ocilib loads dynamically oci.dll and thus the import libraries
    "*.lib" are not used.

    the name of the dll that is loaded is defined by the macro OCI_DL (see
    src\oci_import.h). Thus it cannot be modified à runtime. As mentioned earlier,
    the oracle 32 bits and 64 bits libraries folder path can be passed at runtime
    to OCI_Initialize()
    you can define OCI_DL with the ddl in your project options or in code before
    including ocilib.h

     
  • Josemi Antelo

    Josemi Antelo - 2012-04-03

    Hi Vincent,

    Yes, this is true if I use OCI_IMPORT_RUNTIME, but I compile with
    OCI_IMPORT_LINKAGE option.
    I still do not understand, how VS2005 know what library must to import. I
    found in "oci_import.h" an instruction:

    ifdef _MSC_VER

    pragma comment(lib, "oci.lib")

    endif

    and I thought that was the manner to define the library to import, but not. I
    tried to remove or change the name like this:

    pragma comment(lib, "oci32.lib")

    and the compiler always search "oci.lib" WHY?,
    I'm still think there is any place in your code or wherever where it define
    that library to import is "oci.lib" :'-(

    Thank you

    Yours sincerely
    Josemi

     
  • Nobody/Anonymous

    how about MinGW64 on win7-64bits, the lib64 directory don't contain the
    libociliba.a for 64bits windows.

     
  • Nobody/Anonymous

    I see

    Installing and using OCILIB on Microsoft Windows
    32bits and 64bits DLLs are provided for x86 architectures. Visual .NET
    (2005/2008) solutions are also provided to recompile the Dlls and the demo.
    •Uncompress the archive (ocilib-x.y.z-windows.zip)
    •Copy ocilib\include\ocilib.h to a folder listed in the compiler headers
    folders
    •Copy ocilib.lib to a folder listed in the linker libraries folders
    •Copy ocilib.dll to a folder included in the PATH environment variable

    is the compiled version of OCILIB ('a' -> ANSI, 'w' -> Unicode, 'm' -> Mixed)

    To use OCILIB in a project :
    •include "ocilib.h" in your application
    •define call convention (OCI_API) to __stdcall
    •define charset mode (OCI_CHARSET_ANSI | OCI_CHARSET_MIXED| OCI_CHARSET_WIDE |
    OCI_CHARSET_UFT8)

    Note for MinGW users:
    •Precompiled 32bits static libraries libocilib.a are provided
    •To use OCILIB dll's, copy/rename import libraries ocilib.lib to libocilib.lib
    •Add the desired version (static/shared + charset) of the library to the
    linker options

     
  • Nobody/Anonymous

    gcc -m64 -Id:\ocilib\include -Ld:\ocilib\lib64 -DOCI_CHARSET_ANSI
    -DOCI_API=__stdcall demo.c -o main.exe -lociliba

    异常代码: c0000005

    D:\OCIDev>gcc -v
    Using built-in specs.
    COLLECT_GCC=gcc
    COLLECT_LTO_WRAPPER=d:/strawberry/c/bin/../libexec/gcc/x86_64-w64-mingw32/4.6.
    3/
    lto-wrapper.exe
    Target: x86_64-w64-mingw32
    Configured with: ../../../src/gcc-4.6.3/configure --build=x86_64-w64-mingw32
    --t
    arget=x86_64-w64-mingw32 --enable-languages=c,c++,fortran,objc,obj-c++
    --enable-
    libgomp --enable-lto --enable-bootstrap --enable-checking=release --enable-
    versi
    on-specific-runtime-libs --disable-multilib --disable-nls --disable-
    win32-regist
    ry --disable-werror --with-pkgversion='gcc-4.6.3 release with patches '
    --with-sysroot=/gccbuild/prefix/mingw64 --with-gmp=/
    gccbuild/prefix/mingw64 --with-mpfr=/gccbuild/prefix/mingw64 --with-
    mpc=/gccbuil
    d/prefix/mingw64 --with-ppl=/gccbuild/prefix/mingw64 --with-
    cloog=/gccbuild/pref
    ix/mingw64 --with-bugurl=http://mingwfp.znix.com
    --with-gnu-ld --prefix=/gccbuil
    d/prefix/mingw64 --with-local-prefix=/gccbuild/prefix/mingw64 --with-libiconv-
    pr
    efix=/gccbuild/prefix/mingw64
    Thread model: win32
    gcc version 4.6.3 (gcc-4.6.3 release with patches )

    D:\OCIDev>

    the execute program crashed ...with code c0000005,

    how can I compile the demo with MinGW64 running on Win7 -64bits ....

     
  • Nobody/Anonymous

    where is libociliba.a for MinGW64 in the directory of lib64
    on windows?

    or How can I make one? Please,your wish.

     
    • Anonymous

      Anonymous - 2014-08-20

      Same question, I want to build 64 bit version of liboci.a for MIGW.
      How do I do that?

      ocilib_static_lib_mingw.cbp project only supports 32 bit. I tried building project with 64 bit TDM gcc, but it fails...

      C:\ocilib\src\oci_types.h|253|error: expected '=', ',', ';', 'asm' or 'attribute' before 'ubig_ora'|

       
  • Anonymous

    Anonymous - 2017-04-30
    Post awaiting moderation.