[英]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.