在linux用C++代码链接TimesTen到问题

狮子林 2012-07-18 04:55:30
我在64位centos6.2上安装64位的TimesTen1121.9,安装是成功的,可以用过ttisql访问,并创建表。
我写程序去访问TimesTen,代码如下:
#include "ttclasses/TTConnection.h"
#include "ttclasses/TTCmd.h"
#include "ttclasses/TTStatus.h"

#include <iostream>
using namespace std;

int main() {
//TTCmd cmd;
TTStatus stat;
try{
TTConnection _connTT;
_connTT.Connect("DSN=TT_1121;pwd=svc",stat);
if(_connTT.isConnected())
cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
else
cout<<" connect failed!"<<endl;
}catch(TTError st)
{
cout<<st.err_msg<<endl;
}

return 0;
}
我的问题是:
为只要包含了头文件:#include "ttclasses/TTCmd.h",编译就会报以下错误:
n file included from test.cpp:10:
/home/yleesun/3rd/TimesTen/include/ttclasses/TTCmd.h:365: error: ‘void TTCmd::getColumn(int, SQLBIGINT*, TTStatus&)’ cannot be overloaded
/home/yleesun/3rd/TimesTen/include/ttclasses/TTCmd.h:353: error: with ‘void TTCmd::getColumn(int, long int*, TTStatus&)’
/home/yleesun/3rd/TimesTen/include/ttclasses/TTCmd.h:366: error: ‘bool TTCmd::getColumnNullable(int, SQLBIGINT*, TTStatus&)’ cannot be overloaded
/home/yleesun/3rd/TimesTen/include/ttclasses/TTCmd.h:355: error: with ‘bool TTCmd::getColumnNullable(int, long int*, TTStatus&)’
/home/yleesun/3rd/TimesTen/include/ttclasses/TTCmd.h:367: error: ‘void TTCmd::getColumn(int, SQLBIGINT*)’ cannot be overloaded
/home/yleesun/3rd/TimesTen/include/ttclasses/TTCmd.h:357: error: with ‘void TTCmd::getColumn(int, long int*)’
/home/yleesun/3rd/TimesTen/include/ttclasses/TTCmd.h:368: error: ‘bool TTCmd::getColumnNullable(int, SQLBIGINT*)’ cannot be overloaded
/home/yleesun/3rd/TimesTen/include/ttclasses/TTCmd.h:359: error: with ‘bool TTCmd::getColumnNullable(int, long int*)’
/home/yleesun/3rd/TimesTen/include/ttclasses/TTCmd.h:484: error: ‘void TTCmd::getNextColumn(SQLBIGINT*, TTStatus&)’ cannot be overloaded

如果不包含这个头文件,编译成功,我程序里面调用了连接TT到方法,连接也是成功的!
为何会出现这种情况呢?

在centos 的32位版本上到32位TT,却没有这个问题?难道64位目前还不支持么?请告诉指点!
...全文
180 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
狮子林 2012-07-30
  • 打赏
  • 举报
回复
已解决!重新编译TT库,问题解决!但是在编译的时候,由于TT_64BIT宏未正确声明,需要在NOT DEFINE 的地方注释掉!
狮子林 2012-07-19
  • 打赏
  • 举报
回复
自己顶下!

64,654

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧