crosswire / xiphos

Xiphos is a Bible study tool written for Linux, UNIX, and Windows using GTK, offering a rich and featureful environment for reading, study, and research using modules from The SWORD Project and elsewhere.
http://xiphos.org
GNU General Public License v2.0
202 stars 52 forks source link

Cannot build git master of Xiphos on Fedora 38 - "error: template with C linkage" caused by src/main/sword.h #1133

Closed ArrayBolt3 closed 9 months ago

ArrayBolt3 commented 9 months ago

Attempting to build Xiphos from git master results in a massive number of errors like this:

/usr/include/c++/13/type_traits:652:3: error: template with C linkage
  652 |   template<typename _Tp>
      |   ^~~~~~~~
/home/user/proj/xiphos/xiphos/src/main/sword.h:26:1: note: 'extern "C"' linkage started here
   26 | extern "C" {
      | ^~~~~~~~~~

The issue can be solved by patching src/main/sword.h with the attached patch. The start of the extern "C" block is moved down a bit so that the GTK and GLib includes are no longer inside the extern "C" area. This allows Xiphos to build and run successfully.

0001-Rescope-extern-C-declaration-to-avoid-compile-errors.txt