These are chat archives for rust-lang/rust

10th
Dec 2015
debuuu
@debuuu
Dec 10 2015 08:14
I'm having some difficultly linking to a DLL using the MSVC version of Rust on Windows. The linker finds the .lib, but no matter where I put the .dll (in the project folder, in target, in the folder above target, in the Rust install directory's bin folder..) I get unresolved external symbol linker errors.
debuuu
@debuuu
Dec 10 2015 08:19
The library I'm trying to link to is Assimp, version 3.1.1. I'm beginning to wonder if there's something wrong there, maybe it's compiled without the C exports or something..
Peter Atashian
@retep998
Dec 10 2015 08:51
@debuuu Linking has nothing to do with the .dll
@debuuu If you get unresolved symbol errors while linking that is because the .lib isn't being passed to the linker
or maybe because you're trying to link to the wrong symbols
like, if you're on 32-bit, and you specify the wrong calling convention for the functions, they get mangled differently and they fail to resolve
@debuuu The .dll only matters when you're actually running the program you've built
@debuuu You can check what symbols the .lib exports by using the dumpbin utility that comes with visual studio
dumpbin /EXPORTS blah.lib
mhsjlw
@mhsjlw
Dec 10 2015 12:39
nightly ftw
debuuu
@debuuu
Dec 10 2015 13:11
@retep998 Ahhh, ok. Thanks for the clarification, I don't know too much about the linking process. I noticed in the error that it said like... ok, so if the function I was trying to use was doSomeStuff, the error was saying it couldn't find _doSomeStuff
With the underscore. Could that be something related to the mangling you mentioned?
Peter Atashian
@retep998
Dec 10 2015 21:17
@debuuu Are you sure that the .lib really is being passed to the linker?
@debuuu And what are the exports from the .lib if you use dumpbin on it?