Giter Club home page Giter Club logo

Comments (3)

emilio avatar emilio commented on September 25, 2024

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.

Niwo04 avatar Niwo04 commented on September 25, 2024

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.

emilio avatar emilio commented on September 25, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.