riidefi / RiiStudio

Editor for various 3D model formats
https://riidefi.github.io/RiiStudio/
91 stars 16 forks source link

undefined references to stack trace functions in KMP.cpp #71

Open edbefee3-3888-462a-9411-741b7e9eb54e opened 2 days ago

edbefee3-3888-462a-9411-741b7e9eb54e commented 2 days ago

when I try to compile RiiStudio: I get the following error:


/usr/bin/ld: ../librii/liblibrii.a(KMP.cpp.o): in function `std::basic_stacktrace<std::allocator<std::stacktrace_entry> >::current(std::allocator<std::stacktrace_entry> const&) [clone .isra.0]':
KMP.cpp:(.text+0x3d1): undefined reference to `std::__stacktrace_impl::_S_current(int (*)(void*, unsigned long), void*, int)'
/usr/bin/ld: ../librii/liblibrii.a(KMP.cpp.o): in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > std::to_string<std::allocator<std::stacktrace_entry> >(std::basic_stacktrace<std::allocator<std::stacktrace_entry> > const&)':
KMP.cpp:(.text._ZSt9to_stringISaISt16stacktrace_entryEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt16basic_stacktraceIT_E[_ZSt9to_stringISaISt16stacktrace_entryEENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt16basic_stacktraceIT_E]+0x276): undefined reference to `std::stacktrace_entry::_Info::_M_populate(unsigned long)'
/usr/bin/ld: ../librii/liblibrii.a(SZS.cpp.o): in function `std::basic_stacktrace<std::allocator<std::stacktrace_entry> >::current(std::allocator<std::stacktrace_entry> const&) [clone .isra.0]':
SZS.cpp:(.text+0x51): undefined reference to `std::__stacktrace_impl::_S_current(int (*)(void*, unsigned long), void*, int)'
/usr/bin/ld: ../librii/liblibrii.a(ImagePlatform.cpp.o): in function `std::basic_stacktrace<std::allocator<std::stacktrace_entry> >::current(std::allocator<std::stacktrace_entry> const&) [clone .isra.0]':
ImagePlatform.cpp:(.text+0x51): undefined reference to `std::__stacktrace_impl::_S_current(int (*)(void*, unsigned long), void*, int)'
/usr/bin/ld: ../librii/liblibrii.a(RHST.cpp.o): in function `std::basic_stacktrace<std::allocator<std::stacktrace_entry> >::current(std::allocator<std::stacktrace_entry> const&) [clone .isra.0]':
RHST.cpp:(.text._ZNSt16basic_stacktraceISaISt16stacktrace_entryEE7currentERKS1_.isra.0[_ZN6librii4rhst19JsonSceneTreeReader4readB5cxx11Ev]+0x51): undefined reference to `std::__stacktrace_impl::_S_current(int (*)(void*, unsigned long), void*, int)'
/usr/bin/ld: ../librii/liblibrii.a(TextureIO.cpp.o): in function `std::basic_stacktrace<std::allocator<std::stacktrace_entry> >::current(std::allocator<std::stacktrace_entry> const&) [clone .isra.0]':
TextureIO.cpp:(.text._ZNSt16basic_stacktraceISaISt16stacktrace_entryEE7currentERKS1_.isra.0[_ZN6librii3g3d17ReadStringPointerB5cxx11ESt4spanIKhLm18446744073709551615EEmm]+0x51): undefined reference to `std::__stacktrace_impl::_S_current(int (*)(void*, unsigned long), void*, int)'
/usr/bin/ld: ../librii/liblibrii.a(RARC.cpp.o): in function `std::basic_stacktrace<std::allocator<std::stacktrace_entry> >::current(std::allocator<std::stacktrace_entry> const&) [clone .isra.0]':
RARC.cpp:(.text+0x111): undefined reference to `std::__stacktrace_impl::_S_current(int (*)(void*, unsigned long), void*, int)'
/usr/bin/ld: ../librii/liblibrii.a(U8.cpp.o):U8.cpp:(.text+0x141): more undefined references to `std::__stacktrace_impl::_S_current(int (*)(void*, unsigned long), void*, int)' follow
collect2: error: ld returned 1 exit status```
JoshuaMKW commented 2 days ago

Is -lstdc++exp present? That worked for us with Junior's Toolbox.

riidefi commented 1 day ago

That failing you could configure with cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-DRSL_STACKTRACE_UNSUPPORTED=1", though that would be a reduction of functionality and far less preferable to what Joshua suggested.

edbefee3-3888-462a-9411-741b7e9eb54e commented 1 day ago

Is -lstdc++exp present? That worked for us with Junior's Toolbox.

How would I add that?

JoshuaMKW commented 6 hours ago

Is -lstdc++exp present? That worked for us with Junior's Toolbox.

How would I add that?

We have this:

if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 14)
  target_link_libraries(JuniorsToolbox PRIVATE stdc++exp)
else()
  target_link_libraries(JuniorsToolbox PRIVATE stdc++_libbacktrace)
endif()