Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error "template with C linkage" #8

Open
NerdyProjects opened this issue Jul 16, 2021 · 2 comments
Open

Build error "template with C linkage" #8

NerdyProjects opened this issue Jul 16, 2021 · 2 comments

Comments

@NerdyProjects
Copy link

Trying to build falcon (AUR tudo-falcon 1.3.0-1) on a recent manjaro,

I get build errors:

[ 50%] Building CXX object src/eye/phy/CMakeFiles/eye_phy.dir/SubframeWorker.cc.o
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/gmodule.h:28,
                 from /usr/include/cmnalib/at_sierra_wireless_em7565.h:12,
                 from /home/matthias/.cache/yay/tudo-falcon/src/falcon-1.3.0/lib/include/falcon/meas/probe_modem.h:27,
                 from /home/matthias/.cache/yay/tudo-falcon/src/falcon-1.3.0/lib/include/falcon/meas/TrafficGeneratorEventHandler.h:23,
                 from /home/matthias/.cache/yay/tudo-falcon/src/falcon-1.3.0/lib/include/falcon/meas/DummyEventHandler.h:23,
                 from /home/matthias/.cache/yay/tudo-falcon/src/falcon-1.3.0/lib/src/meas/DummyEventHandler.cc:21:
/usr/include/c++/11.1.0/type_traits:56:3: error: template with C linkage
   56 |   template<typename _Tp, _Tp __v>
      |   ^~~~~~~~
In file included from /home/matthias/.cache/yay/tudo-falcon/src/falcon-1.3.0/lib/include/falcon/meas/TrafficGeneratorEventHandler.h:23,
                 from /home/matthias/.cache/yay/tudo-falcon/src/falcon-1.3.0/lib/include/falcon/meas/DummyEventHandler.h:23,
                 from /home/matthias/.cache/yay/tudo-falcon/src/falcon-1.3.0/lib/src/meas/DummyEventHandler.cc:21:
/home/matthias/.cache/yay/tudo-falcon/src/falcon-1.3.0/lib/include/falcon/meas/probe_modem.h:24:1: note: ‘extern "C"’ linkage started here
   24 | 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/gmodule.h:28,
                 from /usr/include/cmnalib/at_sierra_wireless_em7565.h:12,
                 from /home/matthias/.cache/yay/tudo-falcon/src/falcon-1.3.0/lib/include/falcon/meas/probe_modem.h:27,
                 from /home/matthias/.cache/yay/tudo-falcon/src/falcon-1.3.0/lib/include/falcon/meas/TrafficGeneratorEventHandler.h:23,
                 from /home/matthias/.cache/yay/tudo-falcon/src/falcon-1.3.0/lib/include/falcon/meas/DummyEventHandler.h:23,
                 from /home/matthias/.cache/yay/tudo-falcon/src/falcon-1.3.0/lib/src/meas/DummyEventHandler.cc:21:
/usr/include/c++/11.1.0/type_traits:71:3: error: template with C linkage
   71 |   template<typename _Tp, _Tp __v>
      |   ^~~~~~~~
In file included from /home/matthias/.cache/yay/tudo-falcon/src/falcon-1.3.0/lib/include/falcon/meas/TrafficGeneratorEventHandler.h:23,
                 from /home/matthias/.cache/yay/tudo-falcon/src/falcon-1.3.0/lib/include/falcon/meas/DummyEventHandler.h:23,
                 from /home/matthias/.cache/yay/tudo-falcon/src/falcon-1.3.0/lib/src/meas/DummyEventHandler.cc:21:
/home/matthias/.cache/yay/tudo-falcon/src/falcon-1.3.0/lib/include/falcon/meas/probe_modem.h:24:1: note: ‘extern "C"’ linkage started here
   24 | 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/gmodule.h:28,
                 from /usr/include/cmnalib/at_sierra_wireless_em7565.h:12,
                 from /home/matthias/.cache/yay/tudo-falcon/src/falcon-1.3.0/lib/include/falcon/meas/probe_modem.h:27,
                 from /home/matthias/.cache/yay/tudo-falcon/src/falcon-1.3.0/lib/include/falcon/meas/TrafficGeneratorEventHandler.h:23,
                 from /home/matthias/.cache/yay/tudo-falcon/src/falcon-1.3.0/lib/include/falcon/meas/DummyEventHandler.h:23,
                 from /home/matthias/.cache/yay/tudo-falcon/src/falcon-1.3.0/lib/src/meas/DummyEventHandler.cc:21:
/usr/include/c++/11.1.0/type_traits:80:3: error: template with C linkage
   80 |   template<bool __v>
      |   ^~~~~~~~

and am a bit too stupid to look into it myself. Any hints what requirement I am missing? :D

@NerdyProjects
Copy link
Author

I temporarily downgraded glib2 to version 2.66.7-1 (as I had this lying around) and it worked :-) Found that related issue: https://gitlab.gnome.org/GNOME/glib/-/issues/2331

@bastian-src
Copy link

bastian-src commented Oct 13, 2023

@NerdyProjects thanks a lot for your comment! With your links to the glib issue, I was able to resolve the build error such that falcon can easily be build with glib version 2.72.4 (default of Ubuntu 22.04).

Here is the patch:

It just changes the import and moves it before the extern "C" statement:

diff --git a/lib/include/falcon/meas/probe_modem.h b/lib/include/falcon/meas/probe_modem.h
index 5001867..09b93e1 100644
--- a/lib/include/falcon/meas/probe_modem.h
+++ b/lib/include/falcon/meas/probe_modem.h
@@ -20,11 +20,12 @@
  */
 #pragma once
 
+#include "cmnalib/at_sierra_wireless_em7565.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#include "cmnalib/at_sierra_wireless_em7565.h"
 
 //#define DEFAULT_URL "mptcp1.pi21.de:5002"
 #define DEFAULT_URL "www.kn.e-technik.tu-dortmund.de"

bastian-src added a commit to bastian-src/falcon that referenced this issue Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants