Search code examples
visual-studio-2008managed-c++

Dynamically linking an unmanaged dll in a managed C++ class library


I figured out through trial n error how to link an unmanaged static library to managed C++ dll, but I have no idea how to dynamically include a DLL. Does anyone know how to do this in Visual studio 2008?


Solution

  • I'm trying to link CAIR into my managed assembly. CAIR depends on pthreads, a static or dynamic library for accessing posix functions of any OS.

    This doesn't make sense to me, but the solution was to include the pthreads.lib file into the managed C++ assembly AND dynamically link pthreads.dll into the managed library as well as all consumer projects.

    I was under the impression I didn't need the dll if I statically compiled the lib into my managed assembly.