Subject: Re: compiler issues C/C++ linkage
To: None <netbsd-users@netbsd.org>
From: Christos Zoulas <christos@astron.com>
List: netbsd-users
Date: 12/20/2005 20:12:15
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.