fltk-rs / fltk-flow

A flow widget for fltk-rs (wraps Fl_Flow).
MIT License
4 stars 1 forks source link

Unable to build fltk-flow #5

Open caesay opened 1 month ago

caesay commented 1 month ago

Hi there, thanks for your effort porting important fltk libraries to Rust!

I'm having a problem compiling flow at the moment.

Environment:

Windows x64 1.78.0

Dependencies:

[dependencies]
fltk = "1.4"
fltk-theme = "0.7"
fltk-flow = "0.2"

Error:

error: failed to run custom build command for fltk-flow v0.2.3 fatal error C1083: Cannot open include file: 'cfltk/cfl_macros.h': No such file or directory

Full Log:

cargo run
   Compiling fltk-flow v0.2.3
The following warnings were emitted during compilation:                                                                                                                                                                                                                    

warning: fltk-flow@0.2.3: Compiler family detection failed due to error: ToolExecError: Command "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.38.33130\\bin\\HostX64\\x64\\cl.exe" "-E" "C:\\Source\\velopack-fltk-testing\\target\\debug\\build\\fltk-flow-ab85994f4818abed\\out\\4008782298891870728detect_compiler_family.c" with args C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\bin\HostX64\x64\cl.exe did not execute successfully (status code exit code: 2).
warning: fltk-flow@0.2.3: Compiler family detection failed due to error: ToolExecError: Command "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.38.33130\\bin\\HostX64\\x64\\cl.exe" "-E" "C:\\Source\\velopack-fltk-testing\\target\\debug\\build\\fltk-flow-ab85994f4818abed\\out\\13707250574382911986detect_compiler_family.c" with args C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\bin\HostX64\x64\cl.exe did not execute successfully (status code exit code: 2).

error: failed to run custom build command for `fltk-flow v0.2.3`

Caused by:
  process didn't exit successfully: `C:\Source\velopack-fltk-testing\target\debug\build\fltk-flow-dddea00d1fb8a4c9\build-script-build` (exit code: 1)
  --- stdout
  TARGET = Some("x86_64-pc-windows-msvc")
  OPT_LEVEL = Some("0")
  HOST = Some("x86_64-pc-windows-msvc")
  cargo:rerun-if-env-changed=CXX_x86_64-pc-windows-msvc
  CXX_x86_64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CXX_x86_64_pc_windows_msvc
  CXX_x86_64_pc_windows_msvc = None
  cargo:rerun-if-env-changed=HOST_CXX
  HOST_CXX = None
  cargo:rerun-if-env-changed=CXX
  CXX = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some("cmpxchg16b,fxsr,sse,sse2,sse3")
  DEBUG = Some("true")
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64-pc-windows-msvc
  CXXFLAGS_x86_64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64_pc_windows_msvc
  CXXFLAGS_x86_64_pc_windows_msvc = None
  cargo:rerun-if-env-changed=HOST_CXXFLAGS
  HOST_CXXFLAGS = None
  cargo:rerun-if-env-changed=CXXFLAGS
  CXXFLAGS = None
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:warning=Compiler family detection failed due to error: ToolExecError: Command "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.38.33130\\bin\\HostX64\\x64\\cl.exe" "-E" "C:\\Source\\velopack-fltk-testing\\target\\debug\\build\\fltk-flow-ab85994f4818abed\\out\\4008782298891870728detect_compiler_family.c" with args C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\bin\HostX64\x64\cl.exe did not execute successfully (status code exit code: 2).
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some("cmpxchg16b,fxsr,sse,sse2,sse3")
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64-pc-windows-msvc
  CXXFLAGS_x86_64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64_pc_windows_msvc
  CXXFLAGS_x86_64_pc_windows_msvc = None
  cargo:rerun-if-env-changed=HOST_CXXFLAGS
  HOST_CXXFLAGS = None
  cargo:rerun-if-env-changed=CXXFLAGS
  CXXFLAGS = None
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:warning=Compiler family detection failed due to error: ToolExecError: Command "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.38.33130\\bin\\HostX64\\x64\\cl.exe" "-E" "C:\\Source\\velopack-fltk-testing\\target\\debug\\build\\fltk-flow-ab85994f4818abed\\out\\13707250574382911986detect_compiler_family.c" with args C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\bin\HostX64\x64\cl.exe did not execute successfully (status code exit code: 2).
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some("cmpxchg16b,fxsr,sse,sse2,sse3")
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64-pc-windows-msvc
  CXXFLAGS_x86_64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CXXFLAGS_x86_64_pc_windows_msvc
  CXXFLAGS_x86_64_pc_windows_msvc = None
  cargo:rerun-if-env-changed=HOST_CXXFLAGS
  HOST_CXXFLAGS = None
  cargo:rerun-if-env-changed=CXXFLAGS
  CXXFLAGS = None
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cfl_flow.cpp
  C:\Users\Caelan\.cargo\registry\src\index.crates.io-6f17d22bba15001f\fltk-flow-0.2.3\src\cfl_flow.h(4): fatal error C1083: Cannot open include file: 'cfltk/cfl_macros.h': No such file or directory

  --- stderr

  error occurred: Command "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.38.33130\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-Z7" "-Brepro" "-I" "C:\\Source\\velopack-fltk-testing\\target\\debug\\build\\fltk-flow-ab85994f4818abed\\
out\\../../fltk-sys-1f0791686e752b0e\\out\\include" "-W4" "-FoC:\\Source\\velopack-fltk-testing\\target\\debug\\build\\fltk-flow-ab85994f4818abed\\out\\2e40c9e35e9506f4-cfl_flow.o" "-c" "src/cfl_flow.cpp" with args cl.exe did not execute successfully (status code exit code: 2).
MoAlyousef commented 1 month ago

Hi

Thank you for your kind words and for the report. I tried building and it failed as well, although not the same error message. The bindings needed updating and the build script now specifies the msvc flag /std:c++17 to build fltk-flow. I've published version 0.2.4.

The same project dependencies now work for me. Can you try cargo clean && cargo update, then try building again?