1753776 Members
7096 Online
108799 Solutions
New Discussion юеВ

Compilation Errors

 
Jaya Venkataramanappa
Occasional Contributor

Compilation Errors

Hi,

I am getting the following error while compiling the code on HP UNX machine which has aCC 3.57.

Error 698: Exact position unknown; near ["parser.C", line 194]. # The declarations "void *__catchTp_v[5]" and "void
*std::__catchTp_v[5]" are both visible and neither is preferred under the name lookup rules.
Error 445: "parser.C", line 194 # Cannot recover from earlier errors.
*** Error exit code 2

Can anybody please help me out on this ??
Earlier I have seen this error posted on this site long back but the solution given was code specific and not a general one.
Is there anything as a work around for the same on aCC 03.57 compiler.

Thanks,
Jaya
6 REPLIES 6
Sandman!
Honored Contributor

Re: Compilation Errors

Jaya,

Make sure your declarations follow the ASCII syntax for variable names. Names like __catchTp_v[5] (with square brackets and colons in them are not permissible).

cheers!
Kent Ostby
Honored Contributor

Re: Compilation Errors

Are you using namespaces?

There was a bug that was found and fixed towards the end of last year that was related to how the compiler handled namespaces.

I would suggest getting the latest version of the compiler installed.
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
SG Ganesh
New Member

Re: Compilation Errors

Hi,

This is a known defect in the compiler which is fixed in later versions. Please install A.03.60 or later (the latest is A.03.65) and your problem will go away.

Thanks!
-Ganesh
Jaya Venkataramanappa
Occasional Contributor

Re: Compilation Errors

Thanks for sending in the solutions..
As the aCC 3.57 compiler has problems with namespaces we have added the following declaration in the file and it's dependency files:

namespace std {} using namespace std;

Adding the above declaration for namespace the code has successfully compiled.
Lorenzo del Oeste
Occasional Advisor

Re: Compilation Errors

I'm seeing the exact same error message (except for location) with aCC 03.60, after having upgraded from aCC 03.45 (where this error never occurred):

"Error 698: Exact position unknown; near ["foo.cpp", line 147]. # The declarations "void *__catchTp_v[5]" and "void
*std::__catchTp_v[5]" are both visible and neither is preferred under the name lookup rules."

The method being complained about is declared in a namespace in the header file, and defined in the same namespace. But so are other methods, so it might have something to do with the std::istream & param or std::string result. However, when I try to make a small test case, I can't reproduce the error (in the amount of time I've got).

foo.hpp:
namespace abc
{
class Xyz
{
public:
static std::string func( std::istream & is );
};
}

foo.cpp:
#include "foo.hpp"
namespace abc
{
std::string Xyz::func( std::istream & is )
{ return ""; }
}

Compiling with "aCC -etx -g0 -AA".

The workaround alluded to earlier, putting 'using namespace std;' in a header is not useable here: beyond the fundamental wrongness, it breaks other things.

And, as it turns out, what was needed was the removal of file-scope instances of "using namespace std;". Once I did that (and added "std::" to params, and function-scope "using namespace std;" as needed), the error disappeared -- which isn't too surprising when you read the error message.

Anyway, that last paragraph (and the fact that the error occurs with A.03.60) is the news here.
we have met the enemy, and he is us -- Walt Kelly
Lorenzo del Oeste
Occasional Advisor

Re: Compilation Errors

Correction to my previous post:

s/aCC -etx/aCC -ext/

Larry
we have met the enemy, and he is us -- Walt Kelly