alexxbb / hapi-rs

Idiomatic Rust bindings to Houdini Engine C API
MIT License
64 stars 7 forks source link

Build not working on Windows #7

Closed luxalpa closed 1 year ago

luxalpa commented 1 year ago

Adding the stuff into .cargo/config.toml like in the build guide:

[target.x86_64-pc-windows-msvc]
rustflags = ["-C", "link-arg=-Wl,-rpath,C:/Program Files/Side Effects Software/Houdini/custom/houdini/dsolib"]

I get during build:

rror: linking with `link.exe` failed: exit code: 1181
  |
  = note: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX64\\x64\\link.exe" "/NOLOGO" "C:\\Users\\Luxalpa\\AppData\\Local\\Temp\\rustc9uA4r7\\symbols.o" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\houdini_importer.1crpt80ot2u90y94.rcgu.o" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\houdini_importer.1i0fg1mcq95gmaao.rcgu.o" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\houdini_importer.1ng93v3hmpmpbx4p.rcgu.o" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\houdini_importer.1ojsr272t6t5i6x2.rcgu.o" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\houdini_importer.1qh5a8b531jic9wb.rcgu.o" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\houdini_importer.1znedgjj7mjxzzii.rcgu.o" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\houdini_importer.23621pwqsr47v1cy.rcgu.o" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\houdini_importer.27o6bkrwbwa4u0s6.rcgu.o" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\houdini_importer.2c3lg7kd9nklqqd.rcgu.o" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\houdini_importer.2cg4vggql6ggdj7h.rcgu.o" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\houdini_importer.2dbfktd6iclmezq2.rcgu.o" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\houdini_importer.2kirowquoly571c5.rcgu.o" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\houdini_importer.37myqc167cohv04f.rcgu.o" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\houdini_importer.38b6yol3evkukreu.rcgu.o" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\houdini_importer.3xir2xqysjpu4pse.rcgu.o" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\houdini_importer.3yax5dgl4es3hgk7.rcgu.o" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\houdini_importer.3zashjp1im93yrfi.rcgu.o" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\houdini_importer.4bipk83wjly69lsw.rcgu.o" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\houdini_importer.4exasqy32vmgd07y.rcgu.o" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\houdini_importer.4k4tvf9awcrshw6e.rcgu.o" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\houdini_importer.4sedbsmynl15pt29.rcgu.o" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\houdini_importer.4tdljrvmix3y25p7.rcgu.o" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\houdini_importer.4tt59q0lk3pyagow.rcgu.o" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\houdini_importer.56em67pp45o4buoa.rcgu.o" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\houdini_importer.578q4pz8txc4g376.rcgu.o" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\houdini_importer.57j9wpevrhhm9tbm.rcgu.o" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\houdini_importer.5e8vjwogs8r9g28n.rcgu.o" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\houdini_importer.6rwna6p2gvf2mxg.rcgu.o" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\houdini_importer.d42ssd6xd5pdb4x.rcgu.o" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\houdini_importer.lsayl4kwz5p771c.rcgu.o" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\houdini_importer.m65g9oco8t3go79.rcgu.o" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\houdini_importer.qw1vla9jbbtgj8n.rcgu.o" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\houdini_importer.sl89jg1ko4607mo.rcgu.o" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\houdini_importer.4a1be68i9vxwkcj9.rcgu.o" "/LIBPATH:C:\\projects\\path-of-destruction\\target\\debug\\deps" "/LIBPATH:C:\\Users\\Luxalpa\\.cargo\\registry\\src\\github.com-1ecc6299db9ec823\\windows_x86_64_msvc-0.36.1\\lib" "/LIBPATH:\"C:\\Program Files\\Side Effects Software\\Houdini\"/custom/houdini/dsolib" "/LIBPATH:C:\\Users\\Luxalpa\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\libanyhow-a5e1c10c5bbe0d3f.rlib" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\libhapi_rs-f54c36b45be12ffd.rlib" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\libparking_lot-6e452278e37e6a49.rlib" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\libparking_lot_core-8d0cf1bd81d0ffbd.rlib" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\libwinapi-edaeb2825530e70c.rlib" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\libsmallvec-e6b229e1a0935c40.rlib" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\liblock_api-c71eee33e14c2426.rlib" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\libscopeguard-4b97966267ceb371.rlib" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\libinstant-dd71382793530fe7.rlib" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\liblog-bdb6da71bc715e5a.rlib" "C:\\projects\\path-of-destruction\\target\\debug\\deps\\libcfg_if-7d7b4fec1a06ac6a.rlib" "C:\\Users\\Luxalpa\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libstd-4a00450d169b6eb7.rlib" "C:\\Users\\Luxalpa\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libpanic_unwind-aebdd47781a8ded3.rlib" "C:\\Users\\Luxalpa\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_demangle-75d00692298b803c.rlib" "C:\\Users\\Luxalpa\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libstd_detect-212d184ebbb3da0c.rlib" "C:\\Users\\Luxalpa\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libhashbrown-bb2ae27a3860a710.rlib" "C:\\Users\\Luxalpa\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libminiz_oxide-aebeb1235b6ade9b.rlib" "C:\\Users\\Luxalpa\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libadler-8d905bd195def6d5.rlib" "C:\\Users\\Luxalpa\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_std_workspace_alloc-cdd36af8506e2d87.rlib" "C:\\Users\\Luxalpa\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libunwind-57642f47c953f1ca.rlib" "C:\\Users\\Luxalpa\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcfg_if-ddc101acd19cf3dd.rlib" "C:\\Users\\Luxalpa\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liblibc-304d7f6977c84a4b.rlib" "C:\\Users\\Luxalpa\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liballoc-32d7ee0be9e46c85.rlib" "C:\\Users\\Luxalpa\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_std_workspace_core-015e9ae63a74e3a1.rlib" "C:\\Users\\Luxalpa\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcore-15d7d0533432428b.rlib" "C:\\Users\\Luxalpa\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcompiler_builtins-cfe8447efe28cb1e.rlib" "libHAPIL.lib" "advapi32.lib" "cfgmgr32.lib" "comctl32.lib" "dwmapi.lib" "gdi32.lib" "imm32.lib" "kernel32.lib" "msimg32.lib" "ole32.lib" "opengl32.lib" "shcore.lib" "shell32.lib" "shlwapi.lib" "user32.lib" "uxtheme.lib" "winmm.lib" "winspool.lib" "advapi32.lib" "userenv.lib" "kernel32.lib" "ws2_32.lib" "bcrypt.lib" "msvcrt.lib" "/NXCOMPAT" "/LIBPATH:C:\\Users\\Luxalpa\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "/OUT:C:\\projects\\path-of-destruction\\target\\debug\\deps\\houdini_importer.exe" "/OPT:REF,NOICF" "/DEBUG" "/NATVIS:C:\\Users\\Luxalpa\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\intrinsic.natvis" "/NATVIS:C:\\Users\\Luxalpa\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\liballoc.natvis" "/NATVIS:C:\\Users\\Luxalpa\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\libcore.natvis" "/NATVIS:C:\\Users\\Luxalpa\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\libstd.natvis" "-Wl,-rpath,C:/Program Files/Side Effects Software/Houdini/custom/houdini/dsolib"
  = note: LINK : warning LNK4044: unrecognized option '/Wl,-rpath,C:/Program Files/Side Effects Software/Houdini/custom/houdini/dsolib'; ignored
          LINK : fatal error LNK1181: cannot open input file 'Files\Side.obj'

It seems that the flags are for GCC and not for MSVC which has a different format?!

alexxbb commented 1 year ago

Hi, Yes, the -rpath flag doesn't work on windows, try to remove the .config folder, I don't think it's needed anymore, and try again. Also note, the current version only supports 19.0, I'm working on 19.5 release which will be ready very soon.

luxalpa commented 1 year ago

Oh I see, thanks. Without it, it says

error: process didn't exit successfully: `target\debug\houdini_importer.exe` (exit code: 0xc0000135, STATUS_DLL_NOT_FOUND)

When trying to execute hapi_rs::session::quick_session(). I guess that's because I'm using v19.5?

alexxbb commented 1 year ago

Yes, now add $HFS/bin to your $PATH and it should work.

luxalpa commented 1 year ago

I see, thanks, that indeed did the trick!

alexxbb commented 1 year ago

I see, thanks, that indeed did the trick!

Great! I'm sure there will be issues with 19.5 due to some changes in API, but I'll soon push a new release.

alexxbb commented 1 year ago

Released 0.6.0 with improved build documentation.

luxalpa commented 1 year ago

That's amazing! Thanks a lot! 😄