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

[BUG] BibleTime 3.0.1 compilation error in btfontsettings.cpp:97: ‘qOverload’ was not declared in this scope #332

Closed
haggkoos opened this issue Jul 30, 2021 · 6 comments

Comments

@haggkoos
Copy link

haggkoos commented Jul 30, 2021

I am trying to build Bibletime 3.0.1 (latest release, thank you!)

  1. Downloaded bibletime-3.0.1-tar.xz from release page

  2. I ran build-debug.sh

  3. At ~97% build completions, come to an error:
    In file included from /home/user/.bibletime3_1/bibletime-3.0.1/src/frontend/settingsdialogs/btfontsettings.cpp:25:0: /home/user/.bibletime3_1/bibletime-3.0.1/src/frontend/settingsdialogs/btfontsettings.cpp: In constructor ‘BtFontSettingsPage::BtFontSettingsPage(CConfigurationDialog*)’: /home/user/.bibletime3_1/bibletime-3.0.1/src/frontend/settingsdialogs/btfontsettings.cpp:97:16: error: ‘qOverload’ was not declared in this scope qOverload<int>(&QComboBox::currentIndexChanged),

  4. The build process stops with this output:
    CMakeFiles/bibletime.dir/build.make:1305: recipe for target 'CMakeFiles/bibletime.dir/src/frontend/settingsdialogs/btfontsettings.cpp.o' failed make[2]: *** [CMakeFiles/bibletime.dir/src/frontend/settingsdialogs/btfontsettings.cpp.o] Error 1 make[2]: *** Waiting for unfinished jobs.... CMakeFiles/Makefile2:3679: recipe for target 'CMakeFiles/bibletime.dir/all' failed make[1]: *** [CMakeFiles/bibletime.dir/all] Error 2 Makefile:129: recipe for target 'all' failed make: *** [all] Error 2

I am not experienced enough to know how to fix this, but it does not seem to be dependency issue, rather something more technical.

@jaakristioja
Copy link
Member

I know how to fix this, but first, please specify the platform and compiler are you using.

@jaakristioja
Copy link
Member

jaakristioja commented Jul 31, 2021

As a workaround, you can patch the 3.0.1 sources by applying commit a3f24f3 on top.

However, as I later discovered, the commit message might be incorrect. It seems that the actual reason for us not discovering this issue is that for some reason the build system does not seem to pass -std=c++11 to the compiler as expected.

@jaakristioja jaakristioja changed the title [BUG] Build error from file "btfontsettings.cpp:" [BUG] BibleTime 3.0.1 compilation error in btfontsettings.cpp:97: ‘qOverload’ was not declared in this scope Jul 31, 2021
@jaakristioja
Copy link
Member

It seems that setting the cxx_std_11 compile feature on a target in CMake, and the compiler supports C++11 or a newer version by default, then CMake will not add the respective -std=c++11 (or equivalent) compile flags. So if the compiler supports C++17 by default, CMake will not force it back to C++11, which is the primary direct reason why we didn't see this issue during development.

@haggkoos Please state the name and version of your compiler, the version of CMake, and the name and version of your platform.

@haggkoos
Copy link
Author

haggkoos commented Jul 31, 2021

@jaakristioja Thanks for your help. How do I apply the patch you mentioned? Do I replace the code into the file src/frontend/settingsdialogs/btfontsettings.cpp?

Compiler Version: GNU 7.5.0
Cmake Version: 3.13.4
Platform: Linux Mint 19.3 Cinnamon 64 bit; Cinnamon version 4.4.8; Linux kernel 4.15.0-151-generic

From the build-debug script:

-- The CXX compiler identification is GNU 7.5.0
-- The C compiler identification is GNU 7.5.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Using CMake 3.13.4: /usr/bin/cmake
-- Setting up build environment for BibleTime version 3.0.1
-- Found CLucene library: /usr/lib/x86_64-linux-gnu/libclucene-core.so
-- Found CLucene include dir: /usr/include
-- Found CLucene library dir: /usr/lib/x86_64-linux-gnu
-- Found CLucene shared library: /usr/lib/x86_64-linux-gnu/libclucene-shared.so
-- Found CLucene: /usr/lib/x86_64-linux-gnu/libclucene-core.so;/usr/lib/x86_64-linux-gnu/libclucene-shared.so
-- Found Sword: YES (found suitable version "1.8.900.", minimum required is "1.8.1") 
-- Sword 1.8.900. details:
--     CFLAGS: -I/usr/include/sword
--       INCLUDE_DIRS: /usr/include/sword
--       CFLAGS_OTHER: 
--     LDFLAGS: -lsword
--       LIBRARIES: sword
--       LIBRARY_DIRS: 
--       LDFLAGS_OTHER: 
-- Interprocedural optimization support: YES
-- Found po4a: /usr/bin/po4a
-- Found xsltproc: /usr/bin/xsltproc
-- Found fop: /usr/bin/fop
-- Languages for handbook (HTML): ar br cs de en es fi fr hu it ko lt nl pt_BR ru th uk
-- Languages for handbook (PDF): ar br cs de en es fi fr hu it ko lt nl pt_BR ru th uk
-- Languages for howto (HTML): ar bg br cs da de en es fi fr hu it ja ko lt nl pt_BR ru th uk
-- Languages for howto (PDF): ar bg br cs da de en es fi fr hu it ja ko lt nl pt_BR ru th uk
-- Found XSL for HTML generation: /usr/share/xml/docbook/stylesheet/docbook-xsl/html/chunk.xsl
-- Found XSL for PDF generation: /usr/share/xml/docbook/stylesheet/docbook-xsl/fo/docbook.xsl
-- Configuring done
-- Generating done

@jaakristioja
Copy link
Member

The simplest way would be to edit the file manually, as you would only need to change one line of code. But you could also download the diff from https://github.com/bibletime/bibletime/commit/a3f24f38f5f12eaa221b29af8c35c67fe9745911.diff, verify its contents, and then from inside the source code directory run patch -p1 -i path/to/downloaded.diff. Alternatively, you could clone the BibleTime git repository, check out the stable-3.0 branch, and build BibleTime from there.

@haggkoos
Copy link
Author

Thank you, changing the line of code worked!

@jaakristioja jaakristioja added this to the 3.0.2 milestone Aug 3, 2021
kalemas pushed a commit to kalemas/bibletime that referenced this issue Jan 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants