如何使用代码块为MIGW构建64位版本的Oracle OCI静态库(libocia/w/m.a)
How to build 64 bit version of Oracle OCI static libraries (libocia/w/m.a) for MIGW using Code blocks?
有人知道如何构建64位版本的Oracle OCI静态库吗?
我从http://sourceforge.net/projects/orclib/files/下载了ocilib-3.12.1-windows.zip (2.9 MB)
得到这个ocilib_static_lib_mingw。/proj文件夹下的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:ocilibinclude -c C:ocilibsrcagent.c -o objReleasesrcagent.o
In file included from C:ocilibsrcoci_defs.h:58:0,
from C:ocilibsrcoci_api.h:58,
from C:ocilibsrcoci_import.h:63,
from C:ocilibsrcocilib_defs.h:39,
from C:ocilibsrcocilib_types.h:38,
from C:ocilibsrcocilib_internal.h:38,
from C:ocilibsrcagent.c:35:
C:ocilibsrcoci_types.h:253:25: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'ubig_ora'
typedef unsigned _int64 ubig_ora;
^
C:ocilibsrcoci_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
我没有关于"expected " = "…"错误的线索
I看起来像是检测到Windows平台,因此假设使用了MSVC编译器。旧版本的MSVC不支持int64_t这样的类型定义(但它们有自己的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
...
~
相关文章:
- 如果C++类在类方法中具有动态分配,但没有构造函数/析构函数或任何非静态成员,那么它仍然是POD类型吗
- #为""定义宏;静态";针对不同的上下文
- cmake如何在fedora工作站中找到boost静态库包
- 静态数据成员的问题-修复链接错误会导致编译器错误
- 将公共但非静态的成员函数与ALGLIB集成
- cmake在我的项目中所需的所有静态库都不成功
- C++从另一个类访问公共静态向量的正确方法是什么
- 基于boost的程序的静态链接——zlib问题
- 在静态库中嵌入类方法
- Qt C++静态thread_local QNetworkAccessManager是线程应用程序的好选择吗
- 如何在C++中获得"静态纯虚拟"功能?
- 私有类型的静态常量成员
- 使用gcc从静态链接的文件中查找可选符号
- 在 .h 文件中的类中声明静态变量和在.cpp文件中声明"global"变量有什么区别
- 如何在C++中使用非静态成员函数作为回调函数
- 将静态库链接到不带-fPIC的共享库中
- 静态结构和一个定义规则
- 为什么虚函数不能是静态的和全局的?
- C++17中函数模板中的静态数组初始化(MSVC 2019)
- 如何使用代码块为MIGW构建64位版本的Oracle OCI静态库(libocia/w/m.a)