在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位目前还不支持么?请告诉指点!