Search code examples
c++cwinapidlldependencies

Can .EXE use symbols from an indirectly imported DLL?


I have a Sample.exe project that depends on Common.dll . I need to use libcurl.dll in both Sample.exe and Common.dll . Do I need to import libcurl.lib into both Sample.exe and Common.dll , or will the .EXE module be able to use libcurl.dll if it's imported by Common.dll . So far in my experiments I'm getting "unresolved external" error in Sample.exe project build, even though it references Common.dll that references libcurl.dll .


Solution

  • No, it cannot. The linker doesn't search through the dlls you import for symbols from other dlls it itself imports, nor does it resolve this kind of indirect importing. You'll have to link with libcurl.dll as well.