Skip to content

Fix iconv linking for MinGW builds - #142

Merged
FakeByte merged 1 commit into
masterfrom
mingw-iconv
Aug 28, 2026
Merged

Fix iconv linking for MinGW builds#142
FakeByte merged 1 commit into
masterfrom
mingw-iconv

Conversation

@Hop311

@Hop311 Hop311 commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

This fixes MinGW GCC builds which were previously failing with:

[1/12] Linking CXX executable bin\Debug\openvic-dataloader.headless.exe
FAILED: [code=1] bin/Debug/openvic-dataloader.headless.exe 
C:\Windows\system32\cmd.exe /C "cd . && C:\msys64\mingw64\bin\c++.exe -g  CMakeFiles/openvic-dataloader-headless.dir/Debug/src/headless/main.cpp.obj -o bin\Debug\openvic-dataloader.headless.exe -Wl,--out-implib,Debug\libopenvic-dataloader.headless.dll.a -Wl,--major-image-version,0,--minor-image-version,0  bin/Debug/libopenvic-dataloader.a  _deps/fmt-build/Debug/libfmtd.a  _deps/vmcontainer-build/Debug/libvmcontainer-d.a  _deps/lexy-build/src/Debug/liblexy_file.a  -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/16.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: bin/Debug/libopenvic-dataloader.a(Parser.cpp.obj): in function `auto ovdl::convert::gbk::_make_buffer<lexy::utf8_char_encoding, (lexy::encoding_endianness)2>::operator()<void>(ovdl::detail::Encoding, void const*, unsigned long long, void*) const':
S:/openvic/openvic/extension/deps/openvic-simulation/deps/openvic-dataloader/src/openvic-dataloader/detail/ConvertGbk.hpp:48:(.text$_ZNK4ovdl7convert3gbk12_make_bufferIN4lexy18utf8_char_encodingELNS3_19encoding_endiannessE2EEclIvEEDaNS_6detail8EncodingEPKvyPT_[_ZNK4ovdl7convert3gbk12_make_bufferIN4lexy18utf8_char_encodingELNS3_19encoding_endiannessE2EEclIvEEDaNS_6detail8EncodingEPKvyPT_]+0x78): undefined reference to `libiconv_open'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/16.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: S:/openvic/openvic/extension/deps/openvic-simulation/deps/openvic-dataloader/src/openvic-dataloader/detail/ConvertGbk.hpp:213:(.text$_ZNK4ovdl7convert3gbk12_make_bufferIN4lexy18utf8_char_encodingELNS3_19encoding_endiannessE2EEclIvEEDaNS_6detail8EncodingEPKvyPT_[_ZNK4ovdl7convert3gbk12_make_bufferIN4lexy18utf8_char_encodingELNS3_19encoding_endiannessE2EEclIvEEDaNS_6detail8EncodingEPKvyPT_]+0x15c): undefined reference to `libiconv'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/16.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: S:/openvic/openvic/extension/deps/openvic-simulation/deps/openvic-dataloader/src/openvic-dataloader/detail/ConvertGbk.hpp:219:(.text$_ZNK4ovdl7convert3gbk12_make_bufferIN4lexy18utf8_char_encodingELNS3_19encoding_endiannessE2EEclIvEEDaNS_6detail8EncodingEPKvyPT_[_ZNK4ovdl7convert3gbk12_make_bufferIN4lexy18utf8_char_encodingELNS3_19encoding_endiannessE2EEclIvEEDaNS_6detail8EncodingEPKvyPT_]+0x1a5): undefined reference to `libiconv_close'
collect2.exe: error: ld returned 1 exit status
[9/12] Building CXX object _deps/snitch-build/CMakeFiles/snitch.dir/Debug/src/snitch.cpp.obj
ninja: build stopped: subcommand failed.

This issue also impacted components higher up the dependency chain, preventing MinGW builds.

@Hop311
Hop311 requested a review from a team as a code owner August 28, 2026 07:59
@Hop311 Hop311 added the bug Issue that describes something dysfunctional or erroneous label Aug 28, 2026
@FakeByte
FakeByte added this pull request to the merge queue Aug 28, 2026
Merged via the queue into master with commit 42aa992 Aug 28, 2026
13 checks passed
@FakeByte
FakeByte deleted the mingw-iconv branch August 28, 2026 08:22
@Spartan322 Spartan322 added topic:buildsystem Issue that applies to the buildsystem of the module, like modifying or improving the buildsystem platform:windows Issue relates to Windows in particular labels Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issue that describes something dysfunctional or erroneous platform:windows Issue relates to Windows in particular topic:buildsystem Issue that applies to the buildsystem of the module, like modifying or improving the buildsystem

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants