Subject: compiler issues C/C++ linkage
To: None <netbsd-users@netbsd.org>
From: Tom <th.tom@gmx.de>
List: netbsd-users
Date: 12/20/2005 15:21:10
Hi all,

while compiling a (c++) project originally written on a linux system for 
netbsd, I came to this error:

error: template with C linkage

and on another place 

/usr/include/g++/bits/functexcept.h:40: error: previous declaration of `void
   std::__throw_bad_exception()' with C++ linkage

I really got tons of error of that kind.

I googled arround and found that this seams to be a known problem, when 
compiling code which was written for linux and should be ported to BSD.

Some google hits say, that the compiler does not surround the c-header with 

extern "C" {

}

So I try to do that - without any success.

Funny thing is, that nearly 90% of my code compiles without any complains and 
a few are complaining about this problem.

Does anyone has had similar problems and could solve them?

Tom