[英]How to build 64 bit version of Oracle OCI static libraries (libocia/w/m.a) for MIGW using Code blocks?
有誰知道如何構建Oracle OCI靜態庫的64位版本?
我從http://sourceforge.net/projects/orclib/files/下載了ocilib-3.12.1-windows.zip(2.9 MB)
在/ proj文件夾下獲得了這個ocilib_static_lib_mingw.cbp項目。 它在Migw GCC 32位下可以正常編譯。 但是,它不能在64位Migw GCC 64位以下編譯。
-------------- Build: Release - ANSI in ocilib_static_lib_mingw (compiler: Mingw/TDM 64)---------------
x86_64-w64-mingw32-gcc.exe -O2 -Wall -DOCI_CHARSET_ANSI -DOCI_IMPORT_RUNTIME -DOCI_API=__stdcall -IC:\ocilib\include -c C:\ocilib\src\agent.c -o obj\Release\src\agent.o
In file included from C:\ocilib\src\oci_defs.h:58:0,
from C:\ocilib\src\oci_api.h:58,
from C:\ocilib\src\oci_import.h:63,
from C:\ocilib\src\ocilib_defs.h:39,
from C:\ocilib\src\ocilib_types.h:38,
from C:\ocilib\src\ocilib_internal.h:38,
from C:\ocilib\src\agent.c:35:
C:\ocilib\src\oci_types.h:253:25: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'ubig_ora'
typedef unsigned _int64 ubig_ora;
^
C:\ocilib\src\oci_types.h:254:25: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'sbig_ora'
typedef signed _int64 sbig_ora;
C:\\ ocilib \\ src \\ oci_types.h
#ifdef _WIN64
#ifndef lint
253: typedef unsigned _int64 ubig_ora;
254: typedef signed _int64 sbig_ora;
#else
#define ubig_ora unsigned _int64
#define sbig_ora signed _int64
#endif
我對“預期的'='...”錯誤一無所知
我看起來好像檢測到Windows平台,因此假定使用了MSVC編譯器。 較舊的MSVC版本不支持int64_t之類的typedef(但它們具有自己的版本INT64或_int64)。 由於您的項目是純C語言(沒有C ++)
做這樣的事情:
#ifdef _WIN64
# if defined(_MSC_VER)
# ifndef lint
typedef unsigned _int64 ubig_ora;
typedef signed _int64 sbig_ora;
# else
# define ubig_ora unsigned _int64
# define sbig_ora signed _int64
# endif
# elif defined(__MINGW64__)
# include <stdint.h>
typedef uint64_t ubig_ora;
typedef int64_t sbig_ora;
# endif
...
〜
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.