Extern "C" linkage broken with C++
Hello!
I get a lot of this compiler messages when compiling our C++ application which is using #include <libsoup/soup.h>
. We don't apply extern
on our side because the header does so already for C++. Is this related? What should I do?
In file included from ../Hsw_Server.hpp:8,
from ../Hsw_Coordinator.hpp:8,
from ../Hsw_Coordinator.cpp:5:
/usr/include/libsoup-2.4/libsoup/soup.h:10:1: note: ‘extern "C"’ linkage started here
10 | extern "C" {
| ^~~~~~~~~~
In file included from /usr/include/glib-2.0/glib/gatomic.h:31,
from /usr/include/glib-2.0/glib/gthread.h:32,
from /usr/include/glib-2.0/glib/gasyncqueue.h:32,
from /usr/include/glib-2.0/glib.h:32,
from /usr/include/glib-2.0/gobject/gbinding.h:28,
from /usr/include/glib-2.0/glib-object.h:22,
from /usr/include/glib-2.0/gio/gioenums.h:28,
from /usr/include/glib-2.0/gio/giotypes.h:28,
from /usr/include/glib-2.0/gio/gio.h:26,
from /usr/include/libsoup-2.4/libsoup/soup-types.h:9,
from /usr/include/libsoup-2.4/libsoup/soup-address.h:11,
from /usr/include/libsoup-2.4/libsoup/soup.h:15,
from ../Hsw_Server.hpp:8,
from ../Hsw_Coordinator.hpp:8,
from ../Hsw_Coordinator.cpp:5:
/usr/include/c++/10.2.0/type_traits:3219:3: error: template with C linkage
3219 | template<typename _Tp>
| ^~~~~~~~
The application is compiled with Meson anc GCC 10 using "C++17":
The Meson build system
Version: 0.57.2
Source dir: /home/peter/wcs/carrier
Build dir: /home/peter/wcs/carrier/build2
Build type: native build
Project name: carrier
Project version: 0.93
C++ compiler for the host machine: c++ (gcc 10.2.0 "c++ (GCC) 10.2.0")
C++ linker for the host machine: c++ ld.bfd 2.36.1
Host machine cpu family: x86_64
Host machine cpu: x86_64
Message: linux
Found pkg-config: /usr/bin/pkg-config (1.7.3)
Run-time dependency libmicrohttpd found: YES 0.9.72
Run-time dependency jsoncpp found: YES 1.9.4
Run-time dependency threads found: YES
Configuring config.hpp using configuration
Run-time dependency gtkmm-3.0 found: YES 3.24.4
Run-time dependency libsoup-2.4 found: YES 2.72.0
Build targets in project: 6
Found ninja-1.10.2 at /usr/bin/ninja
A small libsoup sample application which only uses client side features and is compiled by hand seems not be affected. I don't now why.
Thank you