16

I am trying to build a Rust program on Windows 10 having a GUI. When trying to compile a Rust file with gtk dependency on Windows 10 I keep getting the following error messages.

warning: unused manifest key: target.i686-pc-windows-msvc.freetype
warning: unused manifest key: target.x86_64-pc-windows-msvc.freetype
   Compiling freetype-sys v0.13.1
   Compiling glib-sys v0.10.0 (https://github.com/gtk-rs/sys#5f35e26c)
error: failed to run custom build command for `freetype-sys v0.13.1`

Caused by:
  process didn't exit successfully: `F:\KA_IdeaProjects\KA_Test_rustIProject2\target\debug\build\freetype-sys-66d9e52815699227\build-script-build` (exit code: 101)
  --- stdout
  cargo:rerun-if-env-changed=FREETYPE2_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=FREETYPE2_STATIC
  cargo:rerun-if-env-changed=FREETYPE2_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-pc-windows-msvc
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_pc_windows_msvc
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-pc-windows-msvc
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_pc_windows_msvc
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-pc-windows-msvc
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_pc_windows_msvc
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  running: "cmake" "C:\\Users\\3830101\\.cargo\\registry\\src\\github.com-1ecc6299db9ec823\\freetype-sys-0.13.1\\freetype2" "-G" "Visual Studio 16 2019" "-Thost=x64" "-Ax64" "-DWITH_BZip2=OFF" "-DWITH_HarfBuzz=OFF" "-DWITH_PNG=OFF" "-DWITH_ZLIB=OFF" "-DCMAKE_INSTALL_PREFIX=F:\\KA_IdeaProjects\\KA_Test_rustIProject2\\target\\debug\\build\\freetype-sys-ef0fda53c071f0de\\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
  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\3830101\.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
warning: build failed, waiting for other jobs to finish...
error: build failed

How do I fix this error?

9
  • 5
    Like it says in the error: is 'cmake' not installed? Commented Apr 28, 2021 at 12:05
  • Tried installing cmake using cargo install cmake command and getting the following error message Updating crates.io index error: specified package cmake v0.1.45 has no binaries Commented Apr 29, 2021 at 7:06
  • 1
    cmake is not a Rust package but a generic build tool that is used to build Freetype (a C library on which GTK depends). Commented Apr 29, 2021 at 7:14
  • How to install cmake Commented Apr 29, 2021 at 10:35
  • 3
    So you now have the dependencies installed and compiled. That last message is another issue, so please ask another question for it, after searching if one of the existing answers applies to your case. Commented May 5, 2021 at 8:37

2 Answers 2

11

Thank you. My problem was resolved using the following command:

sudo apt install cmake
Sign up to request clarification or add additional context in comments.

8 Comments

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. To get notified when this question gets new answers, you can follow this question. Once you have enough reputation, you can also add a bounty to draw more attention to this question. - From Review
While this code may solve the question, including an explanation of how and why this solves the problem would really help to improve the quality of your post, and probably result in more up-votes. Remember that you are answering the question for readers in the future, not just the person asking now. Please edit your answer to add explanations and give an indication of what limitations and assumptions apply.
The question is clearly related to Windows. How is this going to help?
@mydoghasworms Actually, I'm on Windows and it helped me: just used "winget install cmake" instead of apt and that's all.
|
9

The error is due to cmake not being present.

If you use APT as your package manager you can run the following command to install cmake (as that is what you are missing and is causing the error):

sudo apt install cmake

On Windows, if you have winget installed, you could use

winget install cmake

You might need to close and reopen your terminal after the installation finishes on Windows.

2 Comments

While this code may solve the question, including an explanation of how and why this solves the problem would really help to improve the quality of your post, and probably result in more up-votes. Remember that you are answering the question for readers in the future, not just the person asking now. Please edit your answer to add explanations and give an indication of what limitations and assumptions apply.
The question is clearly related to Windows. How is this going to help?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.