Comments (3)
This smells like the dll not containing the symbols, or it not being marked as dllexport, or rust not finding it properly somehow... Does it happen without bindgen (just with the plain symbol declaration)? How does the function declarations look like in the header (is there any difference between them, like calling convention or something)?
from rust-bindgen.
I used dumpbin to check the lib file and this is the output:
PS C:\Users\janne_lnpq1lo\Desktop\test_lol\src> dumpbin /exports /symbols nvencodeapi.lib
Microsoft (R) COFF/PE Dumper Version 14.39.33523.0
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file nvencodeapi.lib
File Type: LIBRARY
COFF SYMBOL TABLE
000 010161BB ABS notype Static | @comp.id
001 00000000 SECT2 notype External | __IMPORT_DESCRIPTOR_nvEncodeAPI64
002 C0000040 SECT2 notype Section | .idata$2
003 00000000 SECT3 notype Static | .idata$6
004 C0000040 UNDEF notype Section | .idata$4
005 C0000040 UNDEF notype Section | .idata$5
006 00000000 UNDEF notype External | __NULL_IMPORT_DESCRIPTOR
007 00000000 UNDEF notype External | nvEncodeAPI64_NULL_THUNK_DATA
String Table Size = 0x5E bytes
COFF SYMBOL TABLE
000 010161BB ABS notype Static | @comp.id
001 00000000 SECT2 notype External | __NULL_IMPORT_DESCRIPTOR
String Table Size = 0x1D bytes
COFF SYMBOL TABLE
001 00000000 SECT2 notype External | nvEncodeAPI64_NULL_THUNK_DATA
String Table Size = 0x23 bytes
Exports
ordinal name
NvEncodeAPICreateInstance
NvEncodeAPIGetMaxSupportedVersion
Summary
D5 .debug$S
14 .idata$2
14 .idata$3
8 .idata$4
8 .idata$5
12 .idata$6
The functions are indeed missing, but why are they in the .h file when I can't use them. The docs say I should just link to the functions. What can I do to fix this?
from rust-bindgen.
Hmm, I'm honestly not sure, but I don't work on Windows generally, and that seems outside the scope of bindgen... I'd cross-check with other dlls or so? Or maybe you need to dlopen(). Maybe the dynamic library feature in bindgen can help with that?
from rust-bindgen.
Related Issues (20)
- Incorrect field offset when C struct is __attribute__((packed, aligned(8)))
- Windows keeps using MSVC, even when `CC` and `CXX` are set explicitly and empty `PATH` HOT 3
- Bindings for define statements using scientific notation HOT 2
- Panic: Couldn't resolve constant type, and it wasn't an nondeductible auto type or unexposed type! HOT 2
- How to handle C array of undefined size? HOT 1
- Installing bindgen twice with `cargo install --locked` creates different binaries. HOT 2
- Allow wrap-static-fns to be used without experimental feature HOT 2
- Generate `unsafe extern` blocks (Edition 2024) HOT 2
- 🐛Mixed EOL files created on WinOS HOT 1
- new() not found in Callbacks HOT 6
- Clippy warning with 0.70: this operation has no effect HOT 5
- build.rs, Builder and no tests? HOT 4
- ci: unexpected warning with cargo install --locked due to outdated Cargo.lock [easy] [not urgent]
- Support `import_name` and `import_module` attributes when targeting `wasm32` HOT 1
- How to remove the Option in generated function pointer? HOT 1
- _Atomic crashes bindgen even when blocklisted HOT 3
- [libclang5] Wrong code generation surfaced by #2787 HOT 6
- Generate `std::ffi::*` instead of the `std::os::raw::*` types HOT 1
- Linking issues when using Rust-bindgen for a USB CAN driver DLL HOT 3
- Wrong values generated of constants defined by #define for a linux header file. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust-bindgen.