Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error: extra qualification

Status
Not open for further replies.

hectorDUQUE

Programmer
Jan 29, 2007
23
hi guys,

i am just updating form RH7.2 to FC6 :-(

and i got this message whe trying to compile with gcc-c++ 4.1.1

error: extra qualification 'hd::socket::' on member 'connectionName'

may somebody tell me whats going on ?

i am not going to a lower version of gcc ...

thanks in advance


hector
 
You need to post some code in context of the error message.

> error: extra qualification 'hd::socket::' on member 'connectionName'
On the face of it, remove the 'extra' bit which it is complaining about.


--
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
 
hi salem,
code is not important in this case, but here is the problem line:

Code:
 std::string Socket::connectionName();

my problem was that a source code which compiles before (RH7.2), now does not compile (FC6 - gcc-c++ 4.1.1)

anyway, i was looking in the net and i've found this link:


it says:

"FYI this came up yesterday with aspell too and there was a very good
explanation of the problem by Wilco Beekhuizen. He spoke thus:

Extra qualification errors are common with gcc4. This means a class is
redundantly mentioned with a class function. Just remove the part before :: on the mentioned line"


i did it and it compliles now :)

Code:
 std::string connectionName();

hope it will run ....

hector
 
hectorDUQUE said:
code is not important in this case
Actually, posting the context of the code would have probably allowed someone here to provide more information, so it is important if you want the best help. Regardless, it sounds like you got the solution (which is exactly what Salem suggested). So congratulations on that. :)

The actual problem sounds like maybe this code is inside a class definition? Perhaps a class called Socket? Either that or maybe a namespace? If you are inside a class definition or namespace block then you don't need to provide the extra qualification. I guess that link was saying there is a bug in the compiler that errors out upon the unnecessary qualification?
 
hd::socket:: in the original post then Socket::connectionName in the source line. Why?
To post (context) or not to post... What a question!
 
well,
you are right, code context must be posted :-(

in this case, hd is a namespace and socket a class:

Code:
namespace jmc {

...
    class Socket {
         ...

    protected:

         ...
         
          //wrong line:
          //std::string Socket::connectionName();

          //corrected line
          std::string connectionName();

         ...
    }

}

anyway, thank you guys for help .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top