Problem in installing iui and fltk crates

I tried to install many crates but it gave me the same error.
I have tried iui and fltk but still no hope

The Error:

Updating crates.io index
   Compiling proc-macro2 v1.0.24
   Compiling cc v1.0.67
   Compiling libc v0.2.88
   Compiling unicode-xid v0.2.1
   Compiling syn v1.0.62
   Compiling bitflags v1.2.1
   Compiling lazy_static v1.4.0
   Compiling cmake v0.1.45
   Compiling raw-window-handle v0.3.3
   Compiling quote v1.0.9
   Compiling fltk-sys v0.15.7
error: failed to run custom build command for `fltk-sys v0.15.7`

Caused by:
  process didn't exit successfully: `D:\Coding\TutorialProjects\hel\target\debug\build\fltk-sys-572b3d9aa6168ed6\build-script-build` (exit code: 101)
  --- stdout
  cargo:rerun-if-changed=build.rs
  cargo:rerun-if-env-changed=CC
  cargo:rerun-if-env-changed=CXX
  cargo:rerun-if-changed=cfltk/CMakeLists.txt
  cargo:rerun-if-changed=cfltk/include/cfl.h
  cargo:rerun-if-changed=cfltk/include/cfl_widget.h
  cargo:rerun-if-changed=cfltk/include/cfl_group.h
  cargo:rerun-if-changed=cfltk/include/cfl_input.h
  cargo:rerun-if-changed=cfltk/include/cfl_output.h
  cargo:rerun-if-changed=cfltk/include/cfl_window.h
  cargo:rerun-if-changed=cfltk/include/cfl_button.h
  cargo:rerun-if-changed=cfltk/include/cfl_box.h
  cargo:rerun-if-changed=cfltk/include/cfl_menu.h
  cargo:rerun-if-changed=cfltk/include/cfl_dialog.h
  cargo:rerun-if-changed=cfltk/include/cfl_valuator.h
  cargo:rerun-if-changed=cfltk/include/cfl_browser.h
  cargo:rerun-if-changed=cfltk/include/cfl_misc.h
  cargo:rerun-if-changed=cfltk/include/cfl_text.h
  cargo:rerun-if-changed=cfltk/include/cfl_image.h
  cargo:rerun-if-changed=cfltk/include/cfl_draw.h
  cargo:rerun-if-changed=cfltk/include/cfl_table.h
  cargo:rerun-if-changed=cfltk/include/cfl_surface.h
  cargo:rerun-if-changed=cfltk/include/cfl_printer.h
  cargo:rerun-if-changed=cfltk/src/cfl_global.hpp
  cargo:rerun-if-changed=cfltk/src/cfl_new.cpp
  cargo:rerun-if-changed=cfltk/src/cfl.cpp
  cargo:rerun-if-changed=cfltk/src/cfl_widget.cpp
  cargo:rerun-if-changed=cfltk/src/cfl_group.cpp
  cargo:rerun-if-changed=cfltk/src/cfl_window.cpp
  cargo:rerun-if-changed=cfltk/src/cfl_button.cpp
  cargo:rerun-if-changed=cfltk/src/cfl_box.cpp
  cargo:rerun-if-changed=cfltk/src/cfl_menu.cpp
  cargo:rerun-if-changed=cfltk/src/cfl_dialog.cpp
  cargo:rerun-if-changed=cfltk/src/cfl_valuator.cpp
  cargo:rerun-if-changed=cfltk/src/cfl_browser.cpp
  cargo:rerun-if-changed=cfltk/src/cfl_misc.cpp
  cargo:rerun-if-changed=cfltk/src/cfl_text.cpp
  cargo:rerun-if-changed=cfltk/src/cfl_image.cpp
  cargo:rerun-if-changed=cfltk/src/cfl_input.cpp
  cargo:rerun-if-changed=cfltk/src/cfl_output.cpp
  cargo:rerun-if-changed=cfltk/src/cfl_draw.cpp
  cargo:rerun-if-changed=cfltk/src/cfl_table.cpp
  cargo:rerun-if-changed=cfltk/src/cfl_tree.cpp
  cargo:rerun-if-changed=cfltk/src/cfl_surface.cpp
  cargo:rerun-if-changed=cfltk/src/cfl_printer.cpp

  --- stderr
  thread 'main' panicked at 'Git is needed to retrieve the fltk source files!: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', C:\Users\Ahmer Khan\.cargo\registry\src\github.com-1ecc6299db9ec823\fltk-sys-0.15.7\build.rs:93:14
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed

And this is too annoying :(

Do you have the git installed on your PATH? What OS are you on?

1 Like

No I don't have git
is git important

Because previously I installed some other packages and they worked but today it doesn't seem to work

Os is windows 10

OS Name: Microsoft Windows 10 Pro
OS Version: 10.0.19041 N/A Build 19041

It is explicitly required in FLTK documentation.

1 Like

I even installed git

but still not working

Ok now after installing git I have another error
it says cmake not installed and how do I install cmake

Caused by:
  process didn't exit successfully: `D:\Coding\TutorialProjects\hel\target\debug\build\fltk-sys-572b3d9aa6168ed6\build-script-build` (exit code: 101)
  --- stdout
  cargo:rerun-if-changed=build.rs
  cargo:rerun-if-env-changed=CC
  cargo:rerun-if-env-changed=CXX
  cargo:rerun-if-changed=cfltk/CMakeLists.txt
  cargo:rerun-if-changed=cfltk/include/cfl.h
  cargo:rerun-if-changed=cfltk/include/cfl_widget.h
  cargo:rerun-if-changed=cfltk/include/cfl_group.h
  cargo:rerun-if-changed=cfltk/include/cfl_input.h
  cargo:rerun-if-changed=cfltk/include/cfl_output.h
  cargo:rerun-if-changed=cfltk/include/cfl_window.h
  cargo:rerun-if-changed=cfltk/include/cfl_button.h
  cargo:rerun-if-changed=cfltk/include/cfl_box.h
  cargo:rerun-if-changed=cfltk/include/cfl_menu.h
  cargo:rerun-if-changed=cfltk/include/cfl_dialog.h
  cargo:rerun-if-changed=cfltk/include/cfl_valuator.h
  cargo:rerun-if-changed=cfltk/include/cfl_browser.h
  cargo:rerun-if-changed=cfltk/include/cfl_misc.h
  cargo:rerun-if-changed=cfltk/include/cfl_text.h
  cargo:rerun-if-changed=cfltk/include/cfl_image.h
  cargo:rerun-if-changed=cfltk/include/cfl_draw.h
  cargo:rerun-if-changed=cfltk/include/cfl_table.h
  cargo:rerun-if-changed=cfltk/include/cfl_surface.h
  cargo:rerun-if-changed=cfltk/include/cfl_printer.h
  cargo:rerun-if-changed=cfltk/src/cfl_global.hpp
  cargo:rerun-if-changed=cfltk/src/cfl_new.cpp
  cargo:rerun-if-changed=cfltk/src/cfl.cpp
  cargo:rerun-if-changed=cfltk/src/cfl_widget.cpp
  cargo:rerun-if-changed=cfltk/src/cfl_group.cpp
  cargo:rerun-if-changed=cfltk/src/cfl_window.cpp
  cargo:rerun-if-changed=cfltk/src/cfl_button.cpp
  cargo:rerun-if-changed=cfltk/src/cfl_box.cpp
  cargo:rerun-if-changed=cfltk/src/cfl_menu.cpp
  cargo:rerun-if-changed=cfltk/src/cfl_dialog.cpp
  cargo:rerun-if-changed=cfltk/src/cfl_valuator.cpp
  cargo:rerun-if-changed=cfltk/src/cfl_browser.cpp
  cargo:rerun-if-changed=cfltk/src/cfl_misc.cpp
  cargo:rerun-if-changed=cfltk/src/cfl_text.cpp
  cargo:rerun-if-changed=cfltk/src/cfl_image.cpp
  cargo:rerun-if-changed=cfltk/src/cfl_input.cpp
  cargo:rerun-if-changed=cfltk/src/cfl_output.cpp
  cargo:rerun-if-changed=cfltk/src/cfl_draw.cpp
  cargo:rerun-if-changed=cfltk/src/cfl_table.cpp
  cargo:rerun-if-changed=cfltk/src/cfl_tree.cpp
  cargo:rerun-if-changed=cfltk/src/cfl_surface.cpp
  cargo:rerun-if-changed=cfltk/src/cfl_printer.cpp
  running: "cmake" "C:\\Users\\Ahmer Khan\\.cargo\\registry\\src\\github.com-1ecc6299db9ec823\\fltk-sys-0.15.7\\cfltk" "-G" "Visual Studio 16 2019" "-Thost=x64" "-Ax64" "-DOPTION_USE_SYSTEM_LIBPNG=OFF" "-DOPTION_USE_SYSTEM_LIBJPEG=OFF" "-DOPTION_USE_SYSTEM_ZLIB=OFF" "-DCFLTK_LINK_IMAGES=ON" "-DOpenGL_GL_PREFERENCE=GLVND" "-DOPTION_USE_GL=OFF" "-DCFLTK_USE_OPENGL=OFF" "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON" "-DFLTK_BUILD_EXAMPLES=OFF" "-DFLTK_BUILD_TEST=OFF" "-DOPTION_USE_THREADS=ON" "-DOPTION_LARGE_FILE=ON" "-DOPTION_BUILD_HTML_DOCUMENTATION=OFF" "-DOPTION_BUILD_PDF_DOCUMENTATION=OFF" "-DCMAKE_INSTALL_PREFIX=D:\\Coding\\TutorialProjects\\hel\\target\\debug\\build\\fltk-sys-c1b9d3f9f5a70fa6\\out" "-DCMAKE_C_FLAGS= -nologo -MD -Brepro" "-DCMAKE_C_FLAGS_RELEASE= -nologo -MD -Brepro" "-DCMAKE_CXX_FLAGS= -nologo -MD -Brepro" "-DCMAKE_CXX_FLAGS_RELEASE= -nologo -MD -Brepro" "-DCMAKE_ASM_FLAGS= -nologo -MD -Brepro" "-DCMAKE_ASM_FLAGS_RELEASE= -nologo -MD -Brepro" "-DCMAKE_BUILD_TYPE=Release"

  --- stderr
  fatal: not a git repository (or any of the parent directories): .git
  error: patch failed: src/CMakeLists.txt:300
  error: src/CMakeLists.txt: patch does not apply
  error: patch failed: src/Fl_win32.cxx:594
  error: src/Fl_win32.cxx: patch does not apply
  error: patch failed: src/drivers/Android/Fl_Android_System_Driver.H:25
  error: src/drivers/Android/Fl_Android_System_Driver.H: patch does not apply
  thread 'main' panicked at '
  failed to execute command: The system cannot find the file specified. (os error 2)
  is `cmake` not installed?

  build script failed, must exit now', C:\Users\Ahmer Khan\.cargo\registry\src\github.com-1ecc6299db9ec823\cmake-0.1.45\src\lib.rs:894:5
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Download | CMake is the most logical place to start from.

Nevermind it needs git, cmake and also visual studio and I am not gonna do that

Not sure why do you think so. Documentation requires that the C++11 compiler is present, but, if you're using MinGW toolchain, it will provide this too.

2 Likes

Visual Studio itself is not needed. If you have the Rust MSVC toolchain then you most likely have the "Visual Studio C++ Build tools" already installed in your system. You can also use clang or mingw's g++ if you wish. If you have a 64 bit Windows, there are bundles for that as well (msvc and gnu).

[dependencies]
fltk = { version = "0.15", features = ["fltk-bundled"] }

The iui crate also needs CMake and so do many binding projects in Rust (and projects depending on them), so it's useful to have in your system.

This might not work in this case, since, according to docs, this feature requires curl, which is a rare guest on Windows as well.

True. However invoking curl in powershell or the x64 Native Tools Command Prompt (installed with the VS C++ build tools) works by calling "Invoke-WebRequest" which suffices IME.

I'm not sure if Powershell aliases work with Rust Command API, which is used here. And anyway, having tar on Windows without installing it explicitly is even less likely.

Hmm I’m no longer sure. I’ll probably switch to flate2 and tar (crate).

ayy, You are from fltk.
and should I just install the compiler for c++ and git and cmake

The C++ compiler should've been installed when you installed the Visual Studio C++ Build tools required by Rust (assuming you installed the Rust-MSVC toolchain, you can know by invoking rustup show active-toolchain). You would only need CMake and Git (they also need to be in your PATH, i.e. invokable directly through the command line).

stable-x86_64-pc-windows-msvc (default) is my tool chain
I will install git and cmake and then try it