А проблема такая - пишу программу на C++ которая должна взаимодействовать с ORACLE через интерфейс OCI. Но библиотека OCI написана для C и поэтому при компиляции g++ выдаётся куча ошибок.
Lda_Def lda; /* login area */
ub4 hda[HDA_SIZE/(sizeof(ub4))]; /* host area */
Cda_Def cda; /* cursor area */
/* Globals needed */
text tabname [MAX_NAME_LENGTH+1]; /* table name - generated on the fly */
uword tabnum = 0; /* table number */
uword row_count = 0; /* number of rows returned so far */
/* SQL statement used in this program */
//text *sqlstmt = (text *)"select * from test";
text *sqlstmt = (text *)"insert into test values( '123', '456')";
/* return values from query - kept as globals for simplicity */
text col1 [MAX_NAME_LENGTH+1];
text col2 [MAX_NAME_LENGTH+1];
void do_exit(status)
eword status;
{
if (status == OCI_EXIT_FAILURE)
printf("\n Exiting with FAILURE status %d\n", status);
else
printf("\n Exiting with SUCCESS status %d\n", status);
g++ -c -I/oracle/app/oracle/product/9.2/rdbms/demo -I/oracle/app/oracle/product/9.2/rdbms/public -I/oracle/app/oracle/product/9.2/plsql/public -I/oracle/app/oracle/product/9.2/network/public -I/oracle/app/oracle/product/9.2/precomp/public test.cpp
test.cpp: In function `void logon()':
test.cpp:54: too many arguments to function `void err_report()'
test.cpp:65: at this point in file
test.cpp: In function `void logoff()':
test.cpp:56: too many arguments to function `void do_exit()'
test.cpp:77: at this point in file
test.cpp:56: too many arguments to function `void do_exit()'
test.cpp:83: at this point in file
test.cpp: In function `void setup()':
test.cpp:54: too many arguments to function `void err_report()'
test.cpp:91: at this point in file
test.cpp:56: too many arguments to function `void do_exit()'
test.cpp:92: at this point in file
test.cpp:54: too many arguments to function `void err_report()'
test.cpp:98: at this point in file
test.cpp:56: too many arguments to function `void do_exit()'
test.cpp:99: at this point in file
test.cpp: In function `void get_data()':
test.cpp:54: too many arguments to function `void err_report()'
test.cpp:108: at this point in file
test.cpp:56: too many arguments to function `void do_exit()'
test.cpp:109: at this point in file
test.cpp: At global scope:
test.cpp:114: `cursor' was not declared in this scope
test.cpp:115: variable or field `err_report' declared void
test.cpp:115: `int err_report' redeclared as different kind of symbol
test.cpp:54: previous declaration of `void err_report()'
test.cpp:115: syntax error before `*' token
test.cpp:120: parse error before `if'
test.cpp:126: ISO C++ forbids declaration of `n' with no type
test.cpp:126: `cursor' was not declared in this scope
test.cpp:127: ISO C++ forbids declaration of `fprintf' with no type
test.cpp:127: `int fprintf' redeclared as different kind of symbol
/usr/include/stdio.h:298: previous declaration of `int fprintf(FILE*, const
char*, ...)'
test.cpp:127: initializer list being treated as compound expression
test.cpp:127: invalid conversion from `text*' to `int'
test.cpp:128: parse error before `}' token
test.cpp:130: `status' was not declared in this scope
test.cpp:131: variable or field `do_exit' declared void
test.cpp:131: `int do_exit' redeclared as different kind of symbol
test.cpp:56: previous declaration of `void do_exit()'
test.cpp:131: syntax error before `status'
test.cpp:138: `status' was not declared in this scope
test.cpp:138: ISO C++ forbids declaration of `exit' with no type
test.cpp:138: `int exit' redeclared as different kind of symbol
/usr/include/stdlib.h:610: previous declaration of `void exit(int)'
test.cpp:139: parse error before `}' token
test.cpp: In function `int main()':
test.cpp:149: `do_exit' cannot be used as a function
make: *** [all] Error 1