Skip to content

Add or link to documentation on building on Windows #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cyberpunkbln opened this issue Aug 9, 2018 · 5 comments
Closed

Add or link to documentation on building on Windows #34

cyberpunkbln opened this issue Aug 9, 2018 · 5 comments
Labels
c-enhancement New feature or request p-medium Medium Priority

Comments

@cyberpunkbln
Copy link

Hello,

this is the gui-lib that i have searched but i have problems to compile ui-sys with a rust msys2-toolchain.

I have both first a new project with cargo-deps and a git clone. Can anybody shortly explain how i can correct setup cmake enviromnt that i can compile ui-sys.

thx

@NoraCodes
Copy link
Collaborator

NoraCodes commented Aug 9, 2018

Do you have CMake installed? That should be all that's required. https://cmake.org/download/

If you're able to get this working, please report back in detail what you did so I can incorporate it into the documentation. Thanks!

@NoraCodes NoraCodes added c-enhancement New feature or request p-medium Medium Priority labels Aug 9, 2018
@NoraCodes NoraCodes changed the title Short Guide how to Compile ui-sys on Windows msys2? Add or link to documentation on building on Windows Aug 9, 2018
@cyberpunkbln
Copy link
Author

Hello,
thx for your quick reply. At the moment i have MSYS2 installed and loaded all prefered tools with pacman and at last pacman pacman -S mingw-w64-x86_64-cmake. The i have pointed the path to the msys2/mingw64/bin folder and tested i can call cmake.

But i must say i have an Rust-Installation without rustup. The rust-win-64-gnu.....msi:). And the compiling of an windows binary is possible without an msys2-installation.

No i have a complete mingw64/bin path and mingw64/pacman has follwing
pacman -S mingw-w64-x86_64-toolchain
pacman -S base-devel
pacman -S mingw-w64-x86_64-cmake

error: failed to run custom build command for `ui-sys v0.1.3`
process didn't exit successfully: `e:\Development\Rust\TestApp\target\debug\build\ui-sys-b1bfec2b7f044699\build-script-build` (exit code: 101)
--- stdout
git version 2.12.0.windows.1
CMake project was already configured. Skipping configuration step.
running: "cmake" "C:\\Users\\cypu\\.cargo\\registry\\src\\github.1485827954.workers.dev-1ecc6299db9ec823\\ui-sys-0.1.3\\libui" "-G" "MinGW Makefiles" "-DCMAKE_INSTALL_PREFIX=e:\\Development\\Rust\\TestApp\\target\\debug\\build\\ui-sys-b3035054cd4613ef\\out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -m64" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -m64" "-DCMAKE_BUILD_TYPE=release"
-- The C compiler identification is GNU 8.2.0
-- The CXX compiler identification is GNU 8.2.0
-- Check for working C compiler: C:/ProgramData/.msys2/mingw64/bin/gcc.exe
-- Check for working C compiler: C:/ProgramData/.msys2/mingw64/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/ProgramData/.msys2/mingw64/bin/g++.exe
-- Check for working CXX compiler: C:/ProgramData/.msys2/mingw64/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring incomplete, errors occurred!
See also "E:/Development/Rust/TestApp/target/debug/build/ui-sys-b3035054cd4613ef/out/build/CMakeFiles/CMakeOutput.log".

--- stderr
fatal: Not a git repository (or any of the parent directories): .git
CMake Error at windows/CMakeLists.txt:84 (message):
  Sorry, but libui for Windows can currently only be built as a static
  library with MinGW.  You will need to either build as a static library or
  switch to MSVC.


thread 'main' panicked at '
command did not execute successfully, got: exit code: 1

build script failed, must exit now', C:\Users\cypu\.cargo\registry\src\github.1485827954.workers.dev-1ecc6299db9ec823\cmake-0.1.32\src\lib.rs:685:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.

@cyberpunkbln
Copy link
Author

Short Question: I think it is the problem that i use gnu-toolchain. I think. But the fork from @th0rex has no possibility to ask him directly in issues or messages. And i think this is an important question for all that uses the gnu-toolchain on windows. MSVC are Microsoft and the licences are from MIcrosoft and every software 2015-buildtools and 2017-buildtools want a agrree for spionage from me;).

  1. How can i tell cargo that he must use features="static" on the inner-project iu-sys? I mean two different github-repos are not the problem wit [dependencies.iu-sys] but iu-sys is a sub cargo-project from iui and i cannot call the feature static.

  2. Is it possible to became an functional iui-env with gnu-toolchain/mingw? Some workarounds? What happends when i put libui.dll (that i don't cant compile) in an PATH-Env or directly in the run-path?

thx

PS: Why cannot mingw build an dynamical library under windows?

@NoraCodes
Copy link
Collaborator

The problem here is, unfortunately, not with iui but with libui itself; it doesn't support building as a dynamic library under mingw. The relevant issue is andlabs/libui#337; hopefully it should be fixed, but no promises. Sorry!

@cyberpunkbln
Copy link
Author

@LeoTindall

Thx for the link, very interesting to read. I think use a precompiled libui.dll is not possible why the licence from MSVC are not free software compatible. But if i have an libui.dll compiled under an MSVC-Env what must i made that cargo/rust don't compile the ui-sys/libui and take the libui.dll?

@th0rex

Unfortunately you have no possibility for an issue. Can i you ask: Is your Repo with the static fix functionelly? And when the fix is functionally how can i use the static feature? If i build with cargo the ui-sys/folder directly all functioned but i don't know how can i use the static feature in a new cargo project with depencies on your git-repo or with a cloned repo from you?

I personally try the cmakelist.txt hacks on the libui-issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-enhancement New feature or request p-medium Medium Priority
Projects
None yet
Development

No branches or pull requests

2 participants