You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cargo:rustc-link-lib=static=slang
cargo:rustc-link-search={path to .dll and .lib folder}
When I run cargo build --verbose, I see that subsequent calls to rustc include a flag -L {path to .dll and .lib folder}, but when running an example program using that library, the process exits fast with STATUS_DLL_NOT_FOUND. If I remove the call to the native library bindings and dump the PATH, my rustc-link-search path is not present (the search paths for bzip2-sys, curl-sys, and libz-sys do appear in PATH, but examining their respective build.rss and cc-rs's source, I couldn't figure out what they were doing differently).
I found cargo::util::paths::dylib_path(), but couldn't figure out where it was used...
Also, adding cargo:rustc-link-lib=dylib=slang-glslang makes Cargo complain about not being able to find slang-glslang.lib, which confuses me since I expect it to look for slang-glslang.dll and thought .lib was for static libs on Windows.
Edit: If I add cc::Build::new().out_dir(&slang_binaries_path).file("dummy.c").compile("foo") (where dummy.c is an empty file), I correctly get the PATH variable set.
Notes
Output of cargo version: cargo 1.33.0 (f099fe94b 2019-02-12)
* These callbacks are for trimming comments, thus they should be named as such
* I always get
`STATUS_DLL_NOT_FOUND`
error on Windows.
It is something to do with paths.
this rust-lang/cargo#6773
motivated the following change
(I know...)
* Added `is_anonymous`,
which depends on atleast `clang_3_7`,
so that is added, but hopefully it doesn't
Interfere with `runtime`-feature.
- `get_non_api` is only used when `use-bindgen` is enabled.
- Rename `RCallbacks` to reflect what they actually do right now, which is trimming the comments processed by clang, i.e. `TrimCommentsCallbacks`.
- BUG FIX: On Windows paths to dylib/dlls don't get processed properly. Added a `.canonicalize` and it seems to fix it.
- Updated bindgen to latest version `0.64`.
- Added a versioning header to all bindings; e.g.
```
/* bindgen clang version: Ubuntu clang version 14.0.0-1ubuntu1 */
/* clang-rs version: Ubuntu clang version 14.0.0-1ubuntu1 */
/* r version: 4.1.3 */
/* automatically generated by rust-bindgen 0.64.0 */
[...]
````
- BUG FIX: Added a `is_anonymous` check on the entities processed. This is necessary as some unamed items
gets a name in llvm16, and that isn't handled in any meaningful way by `clang-rs` unfortunately. This requires `clang_3_7` atleast, which is also added.
- Updated bindings
---------
Co-authored-by: CGMossa <CGMossa@users.noreply.github.com>
Problem/Steps
I'm trying to create a wrapper for a native library that includes a static
.lib
and two.dll
s.Following the Cargo Book docs on build scripts, I'm outputting (actual source):
When I run
cargo build --verbose
, I see that subsequent calls torustc
include a flag-L {path to .dll and .lib folder}
, but when running an example program using that library, the process exits fast withSTATUS_DLL_NOT_FOUND
. If I remove the call to the native library bindings and dump thePATH
, myrustc-link-search
path is not present (the search paths forbzip2-sys
,curl-sys
, andlibz-sys
do appear inPATH
, but examining their respectivebuild.rs
s andcc-rs
's source, I couldn't figure out what they were doing differently).I found
cargo::util::paths::dylib_path()
, but couldn't figure out where it was used...Also, adding
cargo:rustc-link-lib=dylib=slang-glslang
makes Cargo complain about not being able to findslang-glslang.lib
, which confuses me since I expect it to look forslang-glslang.dll
and thought.lib
was for static libs on Windows.Edit: If I add
cc::Build::new().out_dir(&slang_binaries_path).file("dummy.c").compile("foo")
(wheredummy.c
is an empty file), I correctly get thePATH
variable set.Notes
Output of
cargo version
:cargo 1.33.0 (f099fe94b 2019-02-12)
Rust version:
OS: Windows 10
Thanks for your time!
The text was updated successfully, but these errors were encountered: