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

Fails to build multiple packages, compiler states "ISO C++17 does not allow dynamic exception specifications" #3054

Open
jakint0sh opened this issue Mar 22, 2024 · 4 comments

Comments

@jakint0sh
Copy link
Contributor

jakint0sh commented Mar 22, 2024

It seems there is a C++ standard configuration error for freeimage, lotsa complaints about stuff not being okay in C++ 17.

Terminal output and logfile: https://gist.github.com/jakint0sh/de909bfcca8a4a20dd89cf86cd52fefa

@jakint0sh
Copy link
Contributor Author

Just ran into a nearly identical error building libical:

Failed to build package libical for target i686-w64-mingw32.static!
------------------------------------------------------------
make[3]: *** [CMakeFiles/Makefile2:385: src/libical/CMakeFiles/ical_cxx-static.dir/all] Error 2
make[3]: Leaving directory '/home/jack/dev/mxe-dl/tmp-libical-i686-w64-mingw32.static/libical-2.0.0.build_'
make[2]: *** [Makefile:146: all] Error 2
make[2]: Leaving directory '/home/jack/dev/mxe-dl/tmp-libical-i686-w64-mingw32.static/libical-2.0.0.build_'
make[1]: *** [Makefile:903: build-only-libical_i686-w64-mingw32.static] Error 2
make[1]: Leaving directory '/home/jack/dev/mxe-dl'
real	0m52.462s
user	0m45.163s
sys	0m7.246s
------------------------------------------------------------
[log]      /home/jack/dev/mxe-dl/log/libical_i686-w64-mingw32.static

make: *** [Makefile:891: /home/jack/dev/mxe-dl/usr/i686-w64-mingw32.static/installed/libical] Error 1

Logfile: https://gist.github.com/jakint0sh/f4ac50d95105e70ceabc66951f007cc5

This may be a broader-scope configuration issue...

@jakint0sh jakint0sh changed the title Fails to build freeimage for target i686-w64-mingw32.static Fails to build multiple packages, compiler states "ISO C++17 does not allow dynamic exception specifications" Mar 22, 2024
@uncle-ben-devel
Copy link

I can confirm the problem for freeimage. I tried the x86_64 mingw build.
It will work when using -std=gnu++14 or -std=gnu++11 at compile time.
This can be archived in multiple ways. I edited the patch file using sed:

sed -i 's/CXXFLAGS ?= -O3 -fexceptions -Wno-ctor-dtor-privacy -Wno-narrowing -DNDEBUG $(WIN32_CXXFLAGS)/CXXFLAGS ?= -std=gnu++14 -O3 -fexceptions -Wno-ctor-dtor-privacy -Wno-narrowing -DNDEBUG $(WIN32_CXXFLAGS)/g' "$MXE_ROOT/src/freeimage-1-fixes.patch"

The problem seems to be that the source code is not C++17 compliant, and no C++ standard was specified in the project's original makefile.

@uncle-ben-devel
Copy link

Version 3.15.4 of Freeimage is positively ancient, too (from 2012).
By then, C++17 did not even exist.
I tried with the latest version, which is 3.18.0 (from 2018), with the checksum f41379682f9ada94ea7b34fe86bf9ee00935a3147be41b6569c9605a53e438fd.

Unfortunately, it seems the patch won't apply correctly to that version (or 3.17.0, for that matter).
So for now, the best solution seems to be enforcing C++11 or C++14 on that project.

@uncle-ben-devel
Copy link

The issue is similar with libical. That one can be made to fail in a different way when using C++11 or C++14.

sed -i 's/-DUSE_BUILTIN_TZDATA=true/-DUSE_BUILTIN_TZDATA=true -DCMAKE_CXX_STANDARD=11/g' "$MXE_ROOT/src/libical.mk"

Can be used on that one.

It will fail differently then, complaining about undefined references regarding the icu_74 namespace in the libicuin.a target, so it might miss a linker setting to link against whatever library provides it.
One sample:

undefined reference to `icu_74::SimpleFormatter::format(icu_74::UnicodeString const&, icu_74::UnicodeString&, UErrorCode&) const'

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