Subject: Re: compiler issues C/C++ linkage
To: Christos Zoulas <christos@astron.com>
From: Tom <th.tom@gmx.de>
List: netbsd-users
Date: 12/21/2005 10:14:17
Christos, Martin

Thanks to your advices, I solved the problem:

my configure script for the library does not find "/usr/local" and so just 
uses "/usr" as prefix (that was my false fallback). Then all headers were 
installed to "/usr/include/libname" and the libraries to /usr/lib. This does 
not hurt in any kind...

However, these libraries are written in c++ and the headers are 
in /usr/include, which is, as Christos said, not the right place for c++ 
headers and created this strange errors.

I just created /usr/local/lib and /usr/local/include, deinstalled the old 
libraries and reinstalled them with the headers in the new place and 
everything is fine now.

Never stop learning :-)

Thanks for your support!

Tom
 
Am Dienstag, 20. Dezember 2005 21:12 schrieb Christos Zoulas:
> In article <200512202025.09807.th.tom@gmx.de>, Tom  <th.tom@gmx.de> wrote:
> >Martin,
> >
> >Am Dienstag, 20. Dezember 2005 15:40 schrieb Martin Husemann:
> >> If you could show us a small sample program that causes this problem, we
> >> could check wether it's a problem in the application or a bug in the
> >> installed headers.
> >
> >I have a glimps what's happening. However I didn't got a clue why (ok,
> > maybe I am on the wrong track on library creation)
> >
> >following scenario:
> >
> >testcompile.cpp:
> >#include "testinc.h"
> >
> >#include <string>
> >#include <iostream>
> >
> >int main()
> >{
> >  std::string hallo("String Test");
> >
> >  std::cout<<hallo<<std::endl;
> >}
> >
> >testinc.h:
> >#ifndef testinc_h
> >#define testinc_h
> >
> >#include <list>
> >
> >#endif
>
> It appears that g++ assumes that /usr/include only contains c sources.
> If you change testinc.h to:
>
>
> #ifndef testinc_h
> #define testinc_h
>
> extern "C++" {
> #include <list>
> };
>
> #endif
>
> it works.