spatial-model-editor / sme_deps_common

various libraries statically compiled for linux / macOS / windows
MIT License
2 stars 0 forks source link

VTK linking msys libfmt on windows #33

Open lkeegan opened 4 days ago

lkeegan commented 4 days ago

here we build fmt11 as a static lib.

but it seems that msys also installs libfmt 10.2:

mingw-w64-ucrt-x86_64-fmt-10.2.1-1

VTK builds fine, but when we try to link the spatial-model-editor binary we get:

D:/a/_temp/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/smelibs/lib/libvtkFiltersGeneral-9.3.a(vtkGroupDataSetsFilter.cxx.obj):vtkGroupDataSetsFilter.cxx:(.text+0xa6c): undefined reference to `__imp__ZN3fmt3v107vformatB5cxx11ENS0_17basic_string_viewIcEENS0_17basic_format_argsINS0_20basic_format_contextINS0_8appenderEcEEEE'

demangled this is __imp_fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)

So it looks like VTK is linking the system fmt lib instead of ours.

Maybe there is a cmake arg we can pass to vtk with the libfmt path?

lkeegan commented 4 days ago

It could also be the vtk-bundled fmt, which is also v10.

I can't find a cmake find_package call for fmt in vtk cmake - maybe it just adds the include dirs somewhere.

A temporary fix might be just to downgrade our fmt to v10 for now?