Search code examples
windowslinkercl

How do I specify additional directories for a linker in a cl compiler


I use the cl /EHsc fileName.cpp command in powershell to compile cpp files, and the thing is I cannot find on the web how to specify the paths to additional dependencies for a linker to know where to look for lib files. Same goes with headers


Solution

  • It's right there in the documentation.

    cl /I c:\myheaders /I ..\onemore mycode.c /link /LIBPATH:.\foo /LIBPATH:c:\bar