Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual C++ Library Directories Command Line equivalent

To use some recompiled libraries (f.ex. boost chrono) i need to specify the library folder in visual studio at Properties -> VC++ Directories -> Library Directories. How can i achieve this using the command line? I have been using the /LIBPATH but i get linker error (LNK1104).

like image 731
tropicana Avatar asked Aug 25 '12 18:08

tropicana


People also ask

How do I use Libpath?

Use the /LIBPATH option to override the environment library path. The linker will first search in the path specified by this option, and then search in the path specified in the LIB environment variable. You can specify only one directory for each /LIBPATH option you enter.

How do I enable a 64 bit Visual C++ toolset on the command line?

To access these command prompts on Windows, on the Start menu, open the folder for your version of Visual Studio, and then choose one of the x64 native or cross-tool developer command prompts.

What is Libpath?

The LIBPATH environment variable tells the shell on AIX® systems which directories to search for dynamic-link libraries for the INTERSOLV DataDirect ODBC Driver. You must specify the full path name for the directory where you installed the product.


1 Answers

You need to specify /link <linkoptions> for cl.exe command line to pass the required settings to the linker:

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

like image 73
Rost Avatar answered Nov 15 '22 16:11

Rost