Building on fedora 40 compiles, but fails while linking with 'undefined reference'

I’ve been trying to build blender on fedora 40, but that failed because fedora 40 uses gcc, and g++ 14. I the installed gcc 13, and g++ 13, and switched to these alternatives. That allowed the compile to finish successfully, but the build aborted at 100% while trying to link with error:

[100%] Building C object source/creator/CMakeFiles/blender.dir/buildinfo.c.o
[100%] Linking CXX executable ../../bin/blender
../../lib/libbf_nodes.a(geometry_nodes_gizmos.cc.o):geometry_nodes_gizmos.cc:function blender::nodes::gizmos::foreach_active_gizmo_in_open_editors(wmWindowManager const&, Object const*, NodesModifierData const*, blender::ComputeContextBuilder&, blender::FunctionRef<void (Object const&, NodesModifierData const&, blender::ComputeContext const&, bNode const&, bNodeSocket const&)>) [clone .isra.0] [clone .cold]:(.text.unlikely+0x1aa): error: undefined reference to '__cxa_call_terminate'
../../lib/libbf_nodes.a(geometry_nodes_gizmos.cc.o):geometry_nodes_gizmos.cc:function blender::nodes::gizmos::foreach_active_gizmo_in_open_editors(wmWindowManager const&, Object const*, NodesModifierData const*, blender::ComputeContextBuilder&, blender::FunctionRef<void (Object const&, NodesModifierData const&, blender::ComputeContext const&, bNode const&, bNodeSocket const&)>) [clone .isra.0] [clone .cold]:(.text.unlikely+0x1c7): error: undefined reference to '__cxa_call_terminate'
../../lib/libbf_nodes.a(geometry_nodes_gizmos.cc.o):geometry_nodes_gizmos.cc:function blender::nodes::gizmos::foreach_active_gizmo_exposed_to_modifier(NodesModifierData const&, blender::ComputeContextBuilder&, blender::FunctionRef<void (blender::ComputeContext const&, bNode const&, bNodeSocket const&)>) [clone .cold]:(.text.unlikely+0x1ee): error: undefined reference to '__cxa_call_terminate'
../../lib/libextern_ceres.a(problem_impl.cc.o):problem_impl.cc:function ceres::internal::ScopedExecutionTimer::~ScopedExecutionTimer():(.text._ZN5ceres8internal20ScopedExecutionTimerD2Ev+0x5f6): error: undefined reference to '__cxa_call_terminate'
collect2: error: ld returned 1 exit status
make[3]: *** [source/creator/CMakeFiles/blender.dir/build.make:505: bin/blender] Error 1
make[2]: *** [CMakeFiles/Makefile2:8887: source/creator/CMakeFiles/blender.dir/all] Error 2
make[1]: *** [Makefile:166: all] Error 2
make: *** [GNUmakefile:379: all] Error 2

This is on fedora 40:

Linux fedora 6.10.11-200.fc40.x86_64

The linker is version:

GNU ld version 2.41-37.fc40

I can’t find a solution to this problem.

Aldo Bleeker

That’s a gcc14 call, something didn’t rebuild when you switched to gcc13, i’d probably try a make clean or just wipe your build folder and start from scratch.

@LazyDodo Thanks for the hint!
I’ve wiped the build folder, and rebuild blender, but I’m still getting the same error.
I’ve checked the alternatives, and g++, and gcc definitely point to version 13, so I’ve no idea why it’s still using version 14!

Odd, hmmm check your CMakeCache.txt and see where CMAKE_CXX_COMPILER is pointing to?

1 Like

That’s very interesting, it’s pointing to:

/usr/lib64/ccache

I’ve pointed it, and the C-compiler to the 13 versions. That actually did the trick.
Thanks for the help!