RE: error: 'comp' was not declared in this scope [RESOLVED]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Finally I have got it running by including the <cerrno>. Thanks 
guys for all your support especially Eljay. Again, I don't 
understand why it ran fine without including <cerrno> when it 
was compiled with gcc 3.4.3

Divy.

---------Included Message----------
>Date: 14-Feb-2007 21:54:21 -0500
>From: "John (Eljay) Love-Jensen" <eljay@xxxxxxxxx>
>To: "Divy Kanungo" <divyk@xxxxxxxxxxxxxx>
>Subject: RE: error: 'comp' was not declared in this scope
>
>EBUSY is declared in <cerrno>.  Are you doing the #include 
<cerrno>?
>
>--Eljay
>
>
>-----Original Message-----
>From: Divy Kanungo [mailto:divyk@xxxxxxxxxxxxxx]
>Sent: Wed 2/14/2007 8:19 PM
>To: John (Eljay) Love-Jensen; gcc-help@xxxxxxxxxxx
>Subject: Re: error: 'comp' was not declared in this scope
> 
>Hi Eljay,
>
>Yes, I was not building the libbg.so myself. I guess it was 
>built with GCC 3.4.3
>I am triying to rebuild the whole package with GCC 4.1.1 but 
>again the scope problem is occuring and this time with 'EBUSY' 
>error flag.
>
>error: 'EBUSY' was not declared in this scope
>
>on this line:
>if(pthread_mutex_trylock(&lock) != EBUSY)
>
>Since, EBUSY is standard error flag and there shouldn't be a 
>problem with its scope. What could be wrong here?
>
>Divy.
>
>---------Included Message----------
>>Date: 14-Feb-2007 14:59:34 -0500
>>From: "John Love-Jensen" <eljay@xxxxxxxxx>
>>To: "Divy Kanungo" <divyk@xxxxxxxxxxxxxx>, "MSX to GCC" <gcc-
>help@xxxxxxxxxxx>
>>Subject: Re: error: 'comp' was not declared in this scope
>>
>>Hi Divy,
>>
>>> So, is it that the new gcc version does not allow directly 
>using the protected
>>variabled declared in parent class?
>>
>>I may be mistaken, but I think that the issue has to do with 
>two-phased
>>lookup.  GCC 4.x implements two-phased lookup, as per ISO 
14882.
>>
>>You could also have accessed c by:
>>
>>this->c
>>
>>...or...
>>
>>std::priority_queue< T, std::vector<T>, PLess<T> >::c
>>
>>...but I find the using statement to be the quickest & best 
>solution.
>>
>>> (because that worked fine when I had gcc 3.4.3)
>>
>>GCC 3.4.3 did not implement two-phased lookup.  (Or perhaps it 
>was just that
>>GCC 3.4.3 did not fully implement two-phased lookup.)
>>
>>I'm not sure of all the intricate details between...
>>ADL (argument-dependent name lookup; aka Koenig lookup)
>>OL (ordinary name lookup)
>>FNI (friend name injection)
>>two-phase lookup (aka non-dependent lookup)
>>
>>From <http://safari5.bvdep.com/0201734842/glossary1> ...
>>
>>two-phase lookup
>>The name lookup mechanism used for names in template. The "two 
>phases" are
>>(1) the phase during which a template definition is first 
>encountered by a
>>compiler, and (2) the instantiation of a template. 
Nondependent 
>names are
>>looked up only in the first phase, but during this first phase 
>nondependent
>>base classes are not considered. Dependent names with a scope 
>qualifier (::)
>>are looked up only in the second phase. Dependent names 
without 
>a scope
>>qualifier may be looked up in both phases, but in the second 
>phase only
>>argument-dependent lookup is performed.
>>
>>> Also now I have new issues when I compile the program. I get 
>the following
>>linker errors:
>>
>>That's weird.  It almost looks like you are linking with gcc 
>instead of g++.
>>
>>How are you building libbg.so with GCC 4.x?
>>
>>Or if you are not building libbg.so yourself, it then looks 
>like libbg.so
>>was not built with GCC 4.x.
>>
>>HTH,
>>--Eljay
>>
>>
>>
>---------End of Included Message----------
>
>
>
>
>
---------End of Included Message----------



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux