简体   繁体   English

如何在 cl 编译器中为 linker 指定附加目录

[英]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.我在 powershell 中使用cl /EHsc fileName.cpp命令来编译 cpp 文件,问题是我无法在 web 上找到如何为 linker 指定附加依赖项的路径以了解在哪里查找 lib 文件。 Same goes with headers标题也一样

It's right there in the documentation .它就在文档中。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM