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'

Reply via email to