首页| 论坛| 消息

标题:有关QT4.8.5编译Oracle驱动问题
作者:霸天环宇
日期:2014-11-29 18:21
内容:

我是按照网上的方法,进行编译的。
电脑是win7(64),VS2010,QT4.8.5.先装了oracle 11 R2,按照网上的两种说法都试了一下,
1.在qt4.8.5 command prompt 进行了如下操作
set INCLUDE=D:\app\admin\product\11.2.0\client_2\oci\include;C:\Qt\4.8.5\include
set LIB= D:\app\admin\product\11.2.0\client_2\oci\lib;C:\Qt\4.8.5\lib
cd C:\Qt\4.8.5\src\plugins\sqldrivers\oci.pro
qmake -o Makefile oci.pro
nmake
最后报错,只生成了qsqlocid4.lib和qsqloci4.lib,得不到qsqlocid4.dll和qsqloci4.dll。
2.用Qt creator 打开oci.pro,添加
INCLUDEPATH +=D:\app\admin\product\11.2.0\dbhome_1\OCI\include
LIBS +=D:\app\admin\product\11.2.0\dbhome_1\OCI\lib\MSVC\oci.lib
用Qt直接编译报同样的错误。
哪位大侠遇到过同样的问题,麻烦赐教,万分感谢!
错误如下:
1> 正在创建库 debug\\qsqlocid4.lib 和对象 debug\\qsqlocid4.exp
1>qsql_oci.obj : error LNK2019: 无法解析的外部符号 _OCIDescriptorAlloc,该符号在函数 "public: __thiscall QOCIRowId::QOCIRowId(struct OCIEnv *)" (??0QOCIRowId@@QAE@PAUOCIEnv@@@Z) 中被引用
1>qsql_oci.obj : error LNK2019: 无法解析的外部符号 _OCIDescriptorFree,该符号在函数 "public: __thiscall QOCIRowId::~QOCIRowId(void)" (??1QOCIRowId@@QAE@XZ) 中被引用
1>qsql_oci.obj : error LNK2019: 无法解析的外部符号 _OCIAttrSet,该符号在函数 "public: void __thiscall QOCIResultPrivate::setStatementAttributes(void)" (?setStatementAttributes@QOCIResultPrivate@@QAEXXZ) 中被引用
1>qsql_oci.obj : error LNK2019: 无法解析的外部符号 _OCIBindByPos,该符号在函数 "public: int __thiscall QOCIResultPrivate::bindValue(struct OCIStmt *,struct OCIBind * *,struct OCIError *,int,class QVariant const &,void *,unsigned short *,class QList &)" (?bindValue@QOCIResultPrivate@@QAEHPAUOCIStmt@@PAPAUOCIBind@@PAUOCIError@@HABVQVariant@@PAXPAGAAV?$QList@VQByteArray@@@@@Z) 中被引用
1>qsql_oci.obj : error LNK2019: 无法解析的外部符号 _OCIHandleAlloc,该符号在函数 "public: void __thiscall QOCIDriverPrivate::allocErrorHandle(void) ..


#1 [倾城绝恋 12-01 11:16]
解决了吗?遇到同样的问题
#2 [joryssl3210 12-23 10:45]
我也是,编译从来没有成功过
#3 [w_zhong 08-16 22:53]
遇到类似问题,有没有解决方法。
#4 [huangms 08-12 17:51]
安装32位的Oracle Database Instant Client。然后再编译。千万不要用64位的。否则会出现你这边的错误

回复 发表
主题 版块