In Visual Studio 2010 in Additional Library Directories what does the following mean?
${JOHN_DOE}\libs
Does it mean search for libs folder in JOHN_DOE folder?
Linker will search in JOHN_DOE before it searches the path specified in the LIB environment option.
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. If you want to specify more than one directory, you must specify multiple /LIBPATH options. The linker will then search the specified directories in order.
For more details, check MSDN
Related
I tried to define where to put the .exe generated by cmake + visual studio.
I put this in the cmakefiles.txt
IF(CMAKE_SYSTEM_NAME STREQUAL Windows)
INSTALL(TARGETS
mialsrtkRefineHRMaskByIntersection
DESTINATION ${CMAKE_INSTALL_PREFIX})
ENDIF(CMAKE_SYSTEM_NAME STREQUAL Windows)
but at the end all exe are in the folder of the vcxproj in a subfolder Debut.
is that normal ?
How can I specify the output directory ?
on linux I put destination bin and it works.
What you're setting is the installation destination directory. In Visual Studio, installation is performed by building the special target INSTALL. That is equivalent to make install in Make world.
Note that you can also specify the build output directory. The ways to do that are :
Variable CMAKE_RUNTIME_OUTPUT_DIRECTORY, which provides global settings.
Target property RUNTIME_OUTPUT_DIRECTORY, which controls settings for a particular target.
Both of these have per-configuration variants, or sister variables/properties which affect other things than executables (e.g. CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG). Please see the CMake docs for details.
I'm building wireshark with Visual Studio 2015. After CMake finishes I need to manually add $(WindowsSDK_IncludePath); to the Resources -> Additional Include Directories of multiple projects in the solution. Adding the folders to the general Additional Include Directories of a project doesn't work, Only if I add to the Resources Includes it works. How do I get CMake to Add directories there?
Thanks
set(CMAKE_RC_FLAGS "${CMAKE_RC_FLAGS} /i<path>")
If your code only works with Resource Include Directories, it must rely on the Windows Resource Compiler (rc on command line). So, adding the include directory to your CMAKE_RC_FLAGS settings, the equivalent of adding it as an /i option to rc, should fix it.
What is the complete directory of the visual studio include paths ? For example, they are listed as
$(VC_IncludePath);$(WindowsSDK_IncludePath);
under VC+ Directories - Include Directories. But where is VC_IncludePath ? I tried looking up my environment variables on powershell but there was no listing of those paths.
I've been working on some build scripts, and this is bugging me. I want to be sure that we're independent of environment settings, but in order to be sure of that I feel a need to understand how/where the settings are used by the tools.
The Visual Studio command prompt and/or vcvarsall.bat file set up two distinct environment variables: LIB and LIBPATH. The values are different, but partially overlapping. Here are the values from my system:
LIB=C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\LIB;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\ATLMFC\LIB;C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86;
LIBPATH=C:\Windows\Microsoft.NET\Framework\v4.0.30319;C:\Windows\Microsoft.NET\Framework\v3.5;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\LIB;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\ATLMFC\LIB;C:\Program Files (x86)\Windows Kits\8.0\References\CommonConfiguration\Neutral;\Microsoft.VCLibs\11.0\References\CommonConfiguration\neutral;
I'd just like to understand the rationale for having two different variables -- a little more than the obvious fact that LIBPATH brings in more libs. I've tried looking it up, but I haven't found a clear definition of when each is used by the linker and/or the dev environment.
LIB is for the linker, helps it find import and static libraries.
LIBPATH is for the compiler, helps it find metadata files. Like type libraries, .NET assemblies, WinRT .winmd files.
The LIB environment-variable is passed to the linker,
and helps it to find and import .lib files.
And that, no matter if .lib file belongs to dynamic or static library.
The LIBPATHenvironment-variable is passed to the compiler,
and helps it to find meta-data files.
Like .NET assemblies, type libraries, or WinRT .winmd files.
Also note that, the /LIBPATH command-line option has nothing to do with LIBPATH environment variable, and is just misleadingly named (by Microsoft).
And the path passed using said command-line option, is just searched before LIB environment-variable's paths, like it's prepending a path (which one should not simply call overriding).
I'm trying to use OpenCv 2.2 in Visual Studio 2010.
I've configured everything by instruction:
http://opencv.willowgarage.com/wiki/VisualC%2B%2B
and by instruction from the book:
So I've added all /lib and /include paths.
When I build project, it compiles and before starting app, VS displays an error message that opencv_core220d.dll is missing.
This file is in C:/OpenCV2.2/bin as all .dll files. If I add this file to my working directory - it will be fine. Then VS displays error about every .dll file that I added in Linker-Input configuration ( but with .lib extension ).
So, if I add all .dlls file that I've added as .lib in Linker configuration - to my working directory, project will start.
But why? Why VC doesn't see OpenCV2.2/bin folder? Where is this pointed?
Because it doesn't know to look there by default. However, it does know to check the current directory for the DLLs.
You can tell it where to look by adding C:/OpenCV2.2/bin to your Path variable, or if you would rather not muck up your global Path you can set the Environment variable local to the C++ project.
I think that is the syntax for appending to the Path in VS2010, but I'm not sure, so Google it if that doesn't work :)