How to solve LINK : fatal error LNK1181: cannot open input file 'vtkCommonCore-9.0.lib'
As suggested on this link
vtk_link
I added the command in my CMakeLists.txt
find_package(VTK REQUIRED COMPONENTS CommonCore RenderingOpenGL2)
But nothing changed.
Finally,
I have solved the problem. From conda the package OCCT came with a vtk dependency. I have chosen the same OCCT version (7.4.0) but with a former build number. It solves the problem.
LINK : fatal error LNK1181: cannot open input file 'libclamav.lib'
You get an LNK1181 error in Visual Studio when the .lib or .obj files that are specified during linking are not found in the current directory, any of the directories that are specified by the LIBPATH
linker option, or any of the directories that are specified in the LIB
environment variable.
You may add the directory that contains libclamav.lib
library file to the LIBPATH
to resolve the problem (this instructions may vary a bit depending on your Visual Studio version):
- In Solution Explorer, right-click the project, and then click Properties.
- In the Property Pages dialog box, expand Linker, and then click General.
- In the Additional Library Directories field, specify the path where
libclamav.lib
resides.
The error can also happen when the LIBPATH
contains spaces. If that's the case, move the library to a path without spaces or put quotation marks around the path.
LINK : fatal error LNK1181: cannot open input file 'opencv_world341d.lib'
Thanks for everyone who comments on the question. I have solved the problem, although this problem not relevant to OpenCV to much, but I think the solution to the problem may be helpful to others. When I build project, visual studio 2019 tell me cannot link opencv_world341d.lib
, so I go to Project->Properties->Linker->Input->Additional Dependencies
, and I found opencv_world341d.lib
. So I need to remove it, but it's readonly. From this we know visual studio using settings file (Microsoft.cpp..users.props) to control global settings including Global search path. These files are located at $(USERPROFILE)\appdata\local\microsoft\msbuild\v4.0 directory. Then I reedit Microsoft.cpp.<Platform>.users.props
, delete opencv_world341d.lib
, reboot visual studio, problem solved.
Related Topics
C++ Linker Error with Class Static Constexpr
Using a Static Library in Qt Creator
Version 'Cxxabi_1.3.8' Not Found (Required by ...)
How to Format Date Time Object with Format Dd/Mm/Yyyy
Platform-Independent Guid Generation in C++
Set Local Environment Variables in C++
Class Template for Numeric Types
Pack Expansion for Alias Template
Is "Std::Cout" Usable in Android-Ndk
Inheriting Private Members in C++
How to Tell If a Lib Was Compiled with /Mt or /Md
"To_String" Isn't a Member of "Std"
Compile-Time Map and Inverse Map Values