Domanda

An existing program that is being converted to use Oracle Pro*C is causing problems upon precompilation. It reads a file from the filesystem, parses it, and writes to a couple of database tables.

There's a method with the following definition:

void parse_line(inline)
char *inline;
{
// do stuff
}

When I attempt to make it, I see:

Syntax error at line 162, column 13, file myfile.cp:
Error at line 162, column 13 in file myfile.cp
char *inline;
............1
PCC-S-02201, Encountered the symbol ";" when expecting one of the following:

   ( * const, volatile, an identifier,

This function declaration is syntactically correct as far as I can tell, so I have to assume that this precompiler error is coming up because of a problem elsewhere.

Short of pasting the entire program in here, does anybody have any suggestions as to a few good places I could start looking?

My pcscfg.cfg looks like this:

sys_include=($ORACLE_HOME/precomp/public,/usr/include,/usr/lib/gcc-lib/x86_64-redhat-linux/3.2.3/include,/usr/lib/gcc/x86_64-redhat-linux/4.1.1/include,/usr/lib64/gcc/x86_64-suse-linux/4.1.2/include,/usr/lib64/gcc/x86_64-suse-linux/4.3/include)
ltype=short
define=__x86_64__
È stato utile?

Soluzione

That declaration is invalid since inline is a keyword in C and C++ (and can only be used as a function specifier in C).

Change that variable name to something else, and that should go through if you're compiling as C and not C++. I don't believe that style of function definition syntax is acceptable in C++.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top