Subject: Re: c++ build problem with digikam
To: Mark Davies <mark@mcs.vuw.ac.nz>
From: Julio M. Merino Vidal <jmmv84@gmail.com>
List: tech-pkg
Date: 02/19/2006 10:21:27
I fixed this problem by moving the 'extern "C"' includes block
after the C++ includes one.

The problem comes with the inclusion of tiffio.h, which messes
everything up.  I don't know why exactly, but I guess that this
way some C++ definition has preference over the C one.

Cheers,



On 19/02/2006, at 0:16, Mark Davies wrote:

> Trying to build the latest digikam on NetBSD-current I hit the problem
> demonstrated below
>
> For file foo.cpp:
>
> ------ cut here ------
> // Lib Tiff includes.
>
> extern "C"
> {
> #include <tiffio.h>
> #include <sys/types.h>
> #include <sys/stat.h>
> #include <unistd.h>
> }
>
> // C++ includes.
>
> #include <cmath>
> #include <cstdio>
> #include <cstdlib>
> #include <iostream>
> ------ cut here ------
>
> trying to compile produces the following error:
>
> % c++ -I/usr/pkg/include foo.cpp
> In file included from /usr/include/g++/bits/stl_alloc.h:89,
>                  from /usr/include/g++/memory:55,
>                  from /usr/include/g++/string:48,
>                  from /usr/include/g++/bits/locale_classes.h:47,
>                  from /usr/include/g++/bits/ios_base.h:47,
>                  from /usr/include/g++/ios:49,
>                  from /usr/include/g++/ostream:45,
>                  from /usr/include/g++/iostream:45,
>                  from foo.cpp:16:
> /usr/include/g++/bits/stl_threads.h: In constructor `
>    std::_Refcount_Base::_Refcount_Base(unsigned int)':
> /usr/include/g++/bits/stl_threads.h:74: error: invalid conversion  
> from `void*'
>    to `__pthread_st*'
> /usr/include/g++/bits/stl_threads.h:74: error: invalid conversion  
> from `void*'
>    to `__pthread_st*'
> /usr/include/g++/bits/stl_threads.h:74: error: invalid conversion  
> from `void*'
>    to `__pthread_st**'
> /usr/include/g++/bits/stl_threads.h: At global scope:
> /usr/include/g++/bits/stl_threads.h: In instantiation of  
> `__gthread_mutex_t
> std::_Swap_lock_struct<0>::_S_swap_lock':
> /usr/include/g++/bits/stl_threads.h:122:   instantiated from here
> /usr/include/g++/bits/stl_threads.h:115: error: invalid conversion  
> from
> `void*'
>    to `__pthread_st*'
> /usr/include/g++/bits/stl_threads.h:115: error: invalid conversion  
> from
> `void*'
>    to `__pthread_st*'
> /usr/include/g++/bits/stl_threads.h:115: error: invalid conversion  
> from
> `void*'
>    to `__pthread_st**'
>
>
> Any suggestions on how to fix?
>
> cheers
> mark

-- 
Julio M. Merino Vidal <jmmv84@gmail.com>
The Julipedia - http://julipedia.blogspot.com/