Linker can't find some functions in nvencodeapi.lib

Hello, I have the following problem and I hope that someone can help me with this.

I am coding in Rust with the MSVC build tools. I’m currently working on my way through this article and I got stuck at “Initializing the Hardware Encoder Session” where I need to call NvEncInitializeEncoder. If I try to compile, I get error: linking with `link.exe` failed: exit code: 1120. I’m so confused, because the compiler has the information about where to find the function, otherwise the other functions (for example NvEncodeAPICreateInstance) would not work. How can it be that some functions can be linked but others not?

Using dumpbin I found out that the only functions exported by nvencodeapi.lib are NvEncodeAPICreateInstance and NvEncodeAPIGetMaxSupportedVersion, but why are they then in the nvEncodeAPI.h file if I can’t use them and what do I need to do to fix that?

Hello @jannes.niwolik and welcome to the NVIDIA developer forums.

I am not a Rust programmer, but my feeling is that this paragraph is the key to your issue:

NVENCODE API is a C-API, and uses a design pattern like C++ interfaces, wherein the application creates an instance of the API and retrieves a function pointer table to further interact with the encoder. For programmers preferring more high-level API with ready-to-use code, SDK includes sample C++ classes expose important API functions.

The SDK is aimed at C/C++ code that means you might need to adjust your code to actually be able to compile and link correctly.

Maybe try and port one of the simpler samples that are part of the SDK to Rust and see how that works out?