Opnecv appears "LINK110: Unable to open file opencv_world342d.lib" problem

I have encountered this problem many times, but it always takes a long time to solve it. The summary analysis, in addition to the long time interval for reconfiguring the opencv environment each time, and because there are many reasons for this situation, the summary will produce this kind of problem. There are several reasons for the situation, and new situations will be added at any time in the future: Unable to open opencv-world342d.lib
the general configuration of the opencv development environment is mainly divided into six steps: download and install the OpenCV SDK, configure environment variables, configure the project include directory, configure the project library directory, and link In addition to the configuration of the library, the OpenCV dynamic link library needs to be added to the Windows folder of the C drive. Therefore, when the above-mentioned problem of not being able to open the lib file occurs, it must be that there is a problem with the above-mentioned six links, and each step needs to be eliminated separately.
1. First of all, the first step, the download and installation link, generally does not have this kind of problem. In the process of configuring environment variables in the second link, generally you only need to enter the path of the bin of opencv correctly.
2. The configuration of the project include directory and the configuration of the project library directory: this can be configured on the property page in VS. Because these specific configuration methods can be found online, I won’t say more here. Here I would like to mention the problems I encountered before: After updating or reinstalling VS, the version number of Windows SDK may change. You need to modify the version of Windows SDK in Project>Property Page>Configuration Properties>General. If this is not updated If so, many functions in opencv in the program may not be read correctly.
3. Link library configuration: Here is a common situation where "opencv_world342d.lib cannot be opened". (1) It may be because a long lib file was copied directly on the Internet, but the version numbers of these files were not modified. For example, opencv3.4.2 is installed on our computer, but the lib file of version 3.4.1 is copied from the Internet, so of course it cannot be read correctly. (2) The problem of version number mismatch is relatively easy to find, and there are some problems that I may not care too much about, mainly for the situation where I perform cmake on opencv and then configure the environment. A large section of lib files copied from the Internet needs to match the lib files in the lib folder produced by cmake. If a lib file copied does not exist in the lib folder produced by cmake, of course there will be problems. (3) It is also the case of cmake, and it is also the last link. In the general tutorials on the Internet, it will be prompted to put opencv_worldxxx.lib and opencv_worldxxxd.lib under the lib folder into the corresponding folders under Windows on the C drive. However, when we operate cmake, a large number of lib files will be generated. These Similarly, the file also needs to be placed in the corresponding folder of windows (History of Blood and Tears).
The summary of the above problems is not limited to the problem of "unable to open the file opencv_world342d.lib", other similar problems such as unable to open opencv_highgui342d.lib are also applicable.

Guess you like

Origin blog.csdn.net/qq_38606680/article/details/84299820