Visual C ++ Library Libraries Command Line Equivalent

To use some recompiled libraries (f.ex. boost chrono), I need to specify the library folder in visual studio in Properties β†’ VC ++ Directories β†’ Library Directories. How can I achieve this using the command line? I used / LIBPATH, but I get a linker error (LNK1104).

+8
c ++ command-line compilation linker
source share
1 answer

You need to specify /link <linkoptions> for the /link <linkoptions> command line to pass the necessary settings to the linker:

cl -I "path\to\Boost" test.cpp /link /LIBPATH:"C:\path\to\Boost\stage\lib"

+11
source share

All Articles