[llvm-dev] DllImport: How to specify the library to link to?

Alexander via llvm-dev llvm-dev at lists.llvm.org
Tue Feb 16 11:43:45 PST 2016


Thank you.
So as far as i can see the C-API can merge/optimize/output modules to 
native objectfiles. And linking must be done using lld for example? By 
reading your answer and the lld page i have the following question:

- instead of a .lib file i can use a .dll, right? (your answer implied 
only .lib)
- if i have MyLibA.dll and MyLibB.dll and both export FooA and FooB but 
i want to import FooA from MyLibA and FooB from MyLibB.dll, do i have to 
declare the imports in 2 different llvmmodules for linking?

Is there some document or something to read further? I don't want to 
nuke everybody here with every single question i might have.

Am 16.02.2016 um 20:07 schrieb David Majnemer:
> You don't specify that at the LLVM layer.  Instead, the linker is told 
> which dll you want the import to resolve against by specifying a .lib 
> file as a linker input.
>
> On Tue, Feb 16, 2016 at 11:00 AM, Alexander via llvm-dev 
> <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote:
>
>     Hi,
>     I am absolutely new to LLVM. Currently reading through
>     documentation and the C-API (which i want to use). As i am working
>     on Windows, i was curios on how to specify an import which links
>     to a function exported by a dll. The DLLStorageClass seems to be
>     the wy to go, this seems clear. But after declaring a function for
>     import, how do i specify the DLL the function is included in?
>     _______________________________________________
>     LLVM Developers mailing list
>     llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>
>     http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160216/a5d09ad4/attachment.html>


More information about the llvm-dev mailing list