community: wt/4.0.3/stable can't be cross-compiled Linux to Windows
Description of Problem
Hi; I’m trying to cross-compile from Ubuntu 18.04 x86_64 to Windows x86_64 and setting up a profile for that. I’m following this guide but it’s trying to install msys2_installer
which it shouldn’t do because I already have mingw64 gcc and g++ installed for native Ubuntu. Moreover, msys2_installer
appears to only run on a Windows host.
ERROR: /home/c9/.conan/data/msys2_installer/20161025/bincrafters/stable/export/conanfile.py: Error while initializing settings. Invalid setting 'Linux' is not a valid 'settings.os_build' value.
Possible values are ['Windows']
Read "http://docs.conan.io/en/latest/faq/troubleshooting.html#error-invalid-setting"
Package Details
- Package Name/Version: wt/4.0.3
- Operating System: Linux Ubuntu 18.04
- Compiler+version:
$ /usr/bin/x86_64-w64-mingw32-gcc-win32 --version
x86_64-w64-mingw32-gcc-win32 (GCC) 7.3-win32 20180312
Steps to reproduce
conanfile.txt:
[requires]
wt/4.0.3@bincrafters/stable
[generators]
cmake
l2w.profile:
[env]
CC=/usr/bin/x86_64-w64-mingw32-gcc-7.3-win32
CXX=/usr/bin/x86_64-w64-mingw32-g++-win32
[settings]
os_build=Linux
arch_build=x86_64
# We are cross building to Windows
os=Windows
arch=x86_64
compiler=gcc
compiler.version=7.3
compiler.libcxx=libstdc++11
build_type=Release
conan_build.sh:
#!/bin/bash
mkdir -p wbuild
pushd wbuild >& /dev/null
conan install --build missing --profile ../l2w.profile ..
popd >& /dev/null
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 32 (16 by maintainers)
IN SUMMARY
Cross-compiling from Ubuntu 18.04 to Windows using MinGW64 is possible without modifying the Wt sources using the current Conan package versions and MinGW64 7.3.0 if you do the following:
Then reference the relevant files from https://github.com/allquixotic/conanpatcher-server –
cmc
: script for the conan package dependencies for MinGW64 (others with similar name: c for Linux, mc for MacOS)cmz
: script for building the code I wrote for MinGW64 (others with similar name: z for Linux, mz for MacOS)conanfile.txt
: I disabled wttest and wtisapi modules withoptions
.l2w.profile
: A cross-compile profile provided by, I think it was memshared or you, in another issue.CMakeLists.txt
: Had to add-lwsock32
to link libraries by settingtarget_link_libraries(${PROJECT_NAME} ${CONAN_LIBS} wsock32)
(oh, shoot, I just realized this won’t work for non-Windows platforms 😄)To successfully run the executable on Windows, you must copy files from your MinGW installation to your Windows box:
And then:
And when accessing the app via browser, IT WORKS!
🎉 🎈 🎉 🎈 🎉 🎈 🎉 🎈 🎉 🎈 🎉 🎈
@SSE4 Thank you so much for all your help with this, I really, really appreciate it. The bincrafters community is fantastic!
wsock32 probably has to be added to recipe’s
package_info
method, I’ll add this tomorrow@allquixotic great job! would you write PRs against wt repository?
Looks like you already found the issue with boost_system 😃 This bug is fun; it’s finding bugs in just about every package, hehe.
unfortunately, for me it failed earlier:
but it seems like I’ve found package which includes msys2_installer, it’s lzma, I’ll rebuild it and let you know.