On Sat, Jan 30, 2010 at 12:14:50PM +0100, Peter Kümmel wrote:
> Am Samstag, den 30.01.2010, 01:54 +0100 schrieb Andre Poenitz:
> > On Fri, Jan 29, 2010 at 10:44:03PM +0100, Peter Kümmel wrote:
> > > When enabling the merged build (using cmake)
> > > which essentially is a build of each lib as 
> > > one file, I get often compiler errors which 
> > > are mostly due to multiple defined symbols.
> > > 
> > > But now it looks very strange to me in 
> > > socktools.cpp:
> > > 
> > > int fd;
> > > ...
> > > // bind() gives the local address 'name' for 'fd', also creating
> > > // the socket special file in the filesystem. bind() returns -1
> > > // in case of error
> > > if ((::bind (fd, reinterpret_cast<sockaddr *>(&addr), SUN_LEN(&addr)))
> > > == -1) {
> > > 
> > > the compiler says:
> > > error: ‘int’ is not a class, struct, or union type
> > > and I also wonder how arguments could be bind to a int.
> > > 
> > > And why does it compile without the merge option?
> > > 
> > > Does anyone have an explanation?
> > 
> > Perhaps some funny  #define fd something  earlier.
> > 
> > The canonical approach to debugging this is to get the preprocessed
> > output of the compilation unit and cut it down...
> > 
> > Andre'
> 
> It's a GCC bug, gcc resolves ::bind as boost::bind

Interesting. Haven't seen such seemingly simple scoping problems
for a while.

Andre'

Reply via email to