About the Link:fatal error that appears under Visual Studio 2008/2010 and OPENCV platforms

Source: Internet
Author: User
Tags vc9 microsoft website

Http://blog.sina.com.cn/s/blog_9015f3230101bbef.html

About error resolutions such as Link:fatal error lnk1000/1104 in Visual Studio 2008/2010 and OPENCV platforms

link:fatal error LNK1104: Can't open File ". obj"

because of your common visual Studio 2008/2010 and OPENCV platform programming, like link:fatal error LNK1104: Cannot open the file ". obj";link:fatal Error L NK1104: Can't open File "Xx.lib"; link:fatal Error lnk1000:internal Error during Inc. Such errors are often encountered. According to your own experience, summed up as follows:

First, these errors are generally due to the fact that some novices are unfamiliar with the development environment of the visual Studio 2008/2010 and OPENCV platforms, and are not properly configured to configure environment variables, include files, library files, add dependencies, and so on.

one, for encountering link:fatal error LNK1104: Cannot open the file ". obj";link:fatal error LNK1104: cannot open the file "Xx.lib" Two types of errors, You need to check your environment variables, include files, library files, add dependencies, etc. to see if the configuration is right. In particular, "add dependencies" is most prone to error because the configuration of VS2008 and VS2010 is different. VS2008 between Xx.lib with the space bar, and VS2010 separated by commas, such as I use the latest Opencv2.40 version, in VS2008 configuration:

Enter additional dependencies:Debug Entry : Opencv_calib3d240d.lib opencv_contrib240d.lib opencv_core240d.lib opencv_ Features2d240d.lib opencv_flann240d.lib opencv_gpu240d.lib opencv_highgui240d.lib opencv_imgproc240d.lib opencv_ Legacy240d.lib opencv_ml240d.lib opencv_objdetect240d.lib opencv_ts240d.lib opencv_video240d.lib

Release entry:opencv_calib3d240.lib opencv_contrib240.lib opencv_core240.libopencv_features2d240.lib Opencv_flann240.lib opencv_gpu240.lib opencv_highgui240.lib opencv_imgproc240.lib opencv_legacy240.lib opencv_ Ml240.lib opencv_objdetect240.lib opencv_ts240.lib opencv_video240.lib% (additionaldependencies)

Under VS2010 configuration:

Enter Additional dependencies: Debug Entry: Opencv_calib3d240d.lib;opencv_contrib240d.lib;opencv_core240d.lib;opencv_features2d240d.lib;o Pencv_flann240d.lib;opencv_gpu240d.lib;opencv_highgui240d.lib;opencv_imgproc240d.lib;opencv_legacy240d.lib;o Pencv_ml240d.lib;opencv_objdetect240d.lib;opencv_ts240d.lib;opencv_video240d.lib

Release item: OPENCV_CALIB3D240.LIB;OPENCV_CONTRIB240.LIB;OPENCV_CORE240.LIB;OPENCV_FEATURES2D240.LIB;OPENCV_ Flann240.lib;opencv_gpu240.lib;opencv_highgui240.lib;opencv_imgproc240.lib;opencv_legacy240.lib;opencv_ ml240.lib;opencv_objdetect240.lib;opencv_ts240.lib;opencv_video240.lib;% ( Additionaldependencies)

In addition, I would like to emphasize that whether you are using Windows XP or the WIN7 system, 32-bit or 64-bit, the configuration of the library file is:C:\opencv\build\x86\vc10\lib (vs2010) or C \ Opencv\build\x86\vc9\lib (2008). Rather than C:\opencv\build\x64\vc10\lib or C:\opencv\build\x64\vc9\lib;

I have tried many times for this question, and must be so, no reason. of course, there must be a premise that your OpenCV folder must be placed in the C drive, and follow this path C:\opencv\build\x86\vc10\lib (vs2010) Just can find your Lib library file. If it is D, change the path to D-disk. So when you configure the path, be sure to open the folder step at a time and check the verification path, which is the easiest place to go wrong. For example, your OpenCV file is placed in the C:\programfile\opencv\build ... Or the C:\opencv2.3.1\build .... And so on, or your OPencv folder is named with the uppercase mother, such as: C:\OPencv\build ..., compile time because the Lib file can not be found error. This is true for path settings such as the following environment variables, including directories, and so on.

Similarly, the settings for environment variables are: Path value: C:\opencv\build\x86\vc10\bin; C:\opencv\build\common\tbb\ia32\vc10. or the path value: C:\opencv\build\x86\vc9\bin; C:\opencv\build\common\tbb\ia32\vc9. This is true whether you're using Windows XP or the WIN7 system, 32-bit or 64-bit. Must not be because you are WIN7 64-bit system , and changed into a C:\opencv\build\x64\vc9\bin; C:\OPENCV\BUILD\COMMON\TBB\INTEL64\VC9, this will cause the compilation to fail to connect.

For environment variables, I would also like to emphasize: after each time you change the path value, be sure to remember to restart the computer, after restarting, the changed value is valid.

Include directory: C:\OPENCV\BUILD\INCLUDE\OPENCV; C:\opencv\build\include\opencv2; c:\opencv\build\include;$ (Includepath)

Two, for link:fatal error lnk1000:internal error during incrbuildimage errors:

It is encountered when you install Visual Stdio SP1 under Win7. Write the statutes is encountered link:fatal error lnk1000:internal error during incrbuildimage errors, search the invention is a VS bug, need to patch.

Solutions

1, go to Microsoft website Download KB948127 patch () and install.

Not everyone is honored to install the patch, because I encountered the following during the installation: the machine does not install the Software update support products, click "Void" to exit the installation. As shown in the following:

2, and I as unfortunate installation failure can also choose the following manual to change the project settings.

Select "Enable incremental links (allow Incremental linking)" Under the General (Linker), Linker (properties), (project), and INCREMENTAL) "To" No (/incremental:no) ". But this introduces another warning: FormatCom.obj:warning LNK4075: Ignoring "/editandcontinue" (Because of the "/incremental:no" specification).

Select Project, Properties pages, device properties (Configuration properties)->c/c++, correcting "Debug information Landscape (Debug information Format)" as " Program Database (/ZI).

3, if your fate is not good and the installation failed, and feel that the change project settings are not relied on, you can download SP1 patch package installation.

I did not present error LNK1000 errors after I installed the SP1 patch pack.

Third, if you encounter the error can not pre-compile header file, this is better to do, you only need to put the project---properties----Configuration Properties---C + +---precompiled header inside the drop-down menu options to: Do not use precompiled header, it is good.

About the Link:fatal error that appears under Visual Studio 2008/2010 and OPENCV platforms

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.