工作了几个月,用C++在linux下使用OTL开发Oracle数据库,都是用公司封装好的模板。今天,自己想试试怎么写,想了半天,完全无法下手,不知道改包含什么头文件,不知道改链接什么库文件,哭死,感觉自己什么都不会。
代码如下,只会这么写#include <otlv4.h>
#define OTL_ORA9I
int main( int argc, char* argv[] )
{
otl_connect db;
otl_connect::otl_initialize( 1 ); return 0;
}
以下是编译命令,上网找的,
g++ otltest.cpp -o pro -I$ORACLE_HOME/rdbms/demo -I$ORACLE_HOME/rdbms/public -L$ORACLE_HOME/lib/ -lclntsh 然后就一直报
otltest.cpp:7: error: `otl_connect' was not declared in this scope
otltest.cpp:7: error: expected `;' before "db"
otltest.cpp:8: error: `otl_connect' is not a class or namespace
otltest.cpp:8: error: `otl_initialize' was not declared in this scope
otltest.cpp:7: warning: unused variable 'otl_connect'
otltest.cpp:8: warning: unused variable 'otl_initialize'
这种不是语法错误的错误,我实在找不到原因,网上也找不到,谁能帮帮我,简单的讲述一下linux下用OTL开发的全部过程,除了装ORALCE还要装什么东西等等,在线等。PS:网上找的对于我来说太深奥了。