• 8746阅读
  • 8回复

请问vs2008搭建qt4.6.1,如何引入access数据库 [复制链接]

上一主题 下一主题
离线hxm9065
 
只看楼主 倒序阅读 楼主  发表于: 2011-09-26
关键词: 求助
附加依赖项和附加包含目录应该怎么配?


QSqlDatabase ldb=QSqlDatabase::addDatabase("QODBC");
ldb.setDatabaseName("DRIVER={Microsoft Access Driver (*.mdb)};FIL={MyDB};DBQ=C:/Users/huxiameng/Desktop/gis.mdb");

   ldb.setUserName("hxm");
   ldb.setPassword("9065");
   ldb.setHostName("");
   bool ok=ldb.open();
编译老是无法解析的外部命令。。。。。
离线hxm9065
只看该作者 1楼 发表于: 2011-09-26


请问属性怎么配
离线XChinux

只看该作者 2楼 发表于: 2011-09-26
将编译错误信息帖上来。
二笔 openSUSE Vim N9 BB10 XChinux@163.com 网易博客 腾讯微博
承接C++/Qt、Qt UI界面、PHP及预算报销系统开发业务
离线hxm9065
只看该作者 3楼 发表于: 2011-09-26
回 2楼(XChinux) 的帖子
1>------ 已启动生成: 项目: ossimPlanetQt, 配置: RelWithDebInfo Win32 ------
1>正在链接...
1>   正在创建库 F:\GIS\ossimplanet_src\ossim_package_support\cmake\RelWithDebInfo\ossimPlanetQt.lib 和对象 F:\GIS\ossimplanet_src\ossim_package_support\cmake\RelWithDebInfo\ossimPlanetQt.exp
1>ossimPlanetQtMainWindow.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: __thiscall QSqlDatabase::~QSqlDatabase(void)" (__imp_??1QSqlDatabase@@QAE@XZ),该符号在函数 "public: void __thiscall ossimPlanetQtMainWindow::on_connectDB_clicked(bool)" (?on_connectDB_clicked@ossimPlanetQtMainWindow@@QAEX_N@Z) 中被引用
1>ossimPlanetQtMainWindow.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: __thiscall QSqlQuery::~QSqlQuery(void)" (__imp_??1QSqlQuery@@QAE@XZ),该符号在函数 "public: void __thiscall ossimPlanetQtMainWindow::on_connectDB_clicked(bool)" (?on_connectDB_clicked@ossimPlanetQtMainWindow@@QAEX_N@Z) 中被引用
1>ossimPlanetQtMainWindow.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: __thiscall QSqlQuery::QSqlQuery(class QString const &,class QSqlDatabase)" (__imp_??0QSqlQuery@@QAE@ABVQString@@VQSqlDatabase@@@Z),该符号在函数 "public: void __thiscall ossimPlanetQtMainWindow::on_connectDB_clicked(bool)" (?on_connectDB_clicked@ossimPlanetQtMainWindow@@QAEX_N@Z) 中被引用
1>ossimPlanetQtMainWindow.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: __thiscall QSqlDatabase::QSqlDatabase(class QSqlDatabase const &)" (__imp_??0QSqlDatabase@@QAE@ABV0@@Z),该符号在函数 "public: void __thiscall ossimPlanetQtMainWindow::on_connectDB_clicked(bool)" (?on_connectDB_clicked@ossimPlanetQtMainWindow@@QAEX_N@Z) 中被引用
1>ossimPlanetQtMainWindow.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: bool __thiscall QSqlDatabase::open(void)" (__imp_?open@QSqlDatabase@@QAE_NXZ),该符号在函数 "public: void __thiscall ossimPlanetQtMainWindow::on_connectDB_clicked(bool)" (?on_connectDB_clicked@ossimPlanetQtMainWindow@@QAEX_N@Z) 中被引用
1>ossimPlanetQtMainWindow.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __thiscall QSqlDatabase::setHostName(class QString const &)" (__imp_?setHostName@QSqlDatabase@@QAEXABVQString@@@Z),该符号在函数 "public: void __thiscall ossimPlanetQtMainWindow::on_connectDB_clicked(bool)" (?on_connectDB_clicked@ossimPlanetQtMainWindow@@QAEX_N@Z) 中被引用
1>ossimPlanetQtMainWindow.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __thiscall QSqlDatabase::setPassword(class QString const &)" (__imp_?setPassword@QSqlDatabase@@QAEXABVQString@@@Z),该符号在函数 "public: void __thiscall ossimPlanetQtMainWindow::on_connectDB_clicked(bool)" (?on_connectDB_clicked@ossimPlanetQtMainWindow@@QAEX_N@Z) 中被引用
1>ossimPlanetQtMainWindow.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __thiscall QSqlDatabase::setUserName(class QString const &)" (__imp_?setUserName@QSqlDatabase@@QAEXABVQString@@@Z),该符号在函数 "public: void __thiscall ossimPlanetQtMainWindow::on_connectDB_clicked(bool)" (?on_connectDB_clicked@ossimPlanetQtMainWindow@@QAEX_N@Z) 中被引用
1>ossimPlanetQtMainWindow.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: void __thiscall QSqlDatabase::setDatabaseName(class QString const &)" (__imp_?setDatabaseName@QSqlDatabase@@QAEXABVQString@@@Z),该符号在函数 "public: void __thiscall ossimPlanetQtMainWindow::on_connectDB_clicked(bool)" (?on_connectDB_clicked@ossimPlanetQtMainWindow@@QAEX_N@Z) 中被引用
1>ossimPlanetQtMainWindow.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: static class QSqlDatabase __cdecl QSqlDatabase::addDatabase(class QString const &,class QString const &)" (__imp_?addDatabase@QSqlDatabase@@SA?AV1@ABVQString@@0@Z),该符号在函数 "public: void __thiscall ossimPlanetQtMainWindow::on_connectDB_clicked(bool)" (?on_connectDB_clicked@ossimPlanetQtMainWindow@@QAEX_N@Z) 中被引用
1>ossimPlanetQtMainWindow.obj : error LNK2001: 无法解析的外部符号 "__declspec(dllimport) public: static char * QSqlDatabase::defaultConnection" (__imp_?defaultConnection@QSqlDatabase@@2PADA)
1>F:\GIS\ossimplanet_src\ossim_package_support\cmake\RelWithDebInfo\ossimPlanetQt.dll : fatal error LNK1120: 11 个无法解析的外部命令
1>生成日志保存在“file://f:\GIS\ossimplanet_src\ossim_package_support\cmake\ossimPlanetQt\ossimPlanetQt.dir\RelWithDebInfo\BuildLog.htm”
1>ossimPlanetQt - 12 个错误,0 个警告
2>------ 已启动生成: 项目:  ossimplanetGui, 配置: RelWithDebInfo Win32 ------
2>正在执行预链接事件...
2>正在链接...
2>正在嵌入清单...
2>生成日志保存在“file://f:\GIS\ossimplanet_src\ossim_package_support\cmake\ossimPlanetQt\ossimplanetGui.dir\RelWithDebInfo\BuildLog.htm”
2> ossimplanetGui - 0 个错误,0 个警告
========== 生成: 成功 1 个,失败 1 个,最新 51 个,跳过 0 个 ==========
感激不尽啊
离线XChinux

只看该作者 4楼 发表于: 2011-09-26
在.pro中加入 
QT += sql
二笔 openSUSE Vim N9 BB10 XChinux@163.com 网易博客 腾讯微博
承接C++/Qt、Qt UI界面、PHP及预算报销系统开发业务
离线hxm9065
只看该作者 5楼 发表于: 2011-09-27
回 4楼(XChinux) 的帖子
请问具体是在哪个.pro文件中加入,加入后直接编译就行了吗?
离线downstairs

只看该作者 6楼 发表于: 2011-11-26
右键项目。属性配置里有啊
喜爱编程的猫头鹰
离线xiangyuwen
只看该作者 7楼 发表于: 2012-06-18
你编译成功ossimplanetQT这个工程成功后,在release文件夹下,有没有生成ossimplanet.exe这个文件呢
我编译通过了。在vs2008 sp1(with qt plugin)编译。但是没有生成ossimplanet.exe这个文件。郁闷啊。
离线sakura8000
只看该作者 8楼 发表于: 2012-11-03
你好。。请问有编译成功的详细教程么。。。我按照网上的进行 但还是不行。。求助。。
快速回复
限100 字节
 
上一个 下一个