Fatal error lnk1112: the module computer type "x86" conflicts with the target computer type "x64"-My Solution

Source: Internet
Author: User

 Install vs2008 in win7 and run it with opencv2.3.1. The error is:Fatal error lnk1112: the module computer type "x86" conflicts with the target computer type "x64. The answer to the error through online queries is similar, but there are still many friends who cannot solve the problem according to the online answer. Here is my solution, which is for reference only:

1. cause: the 64-bit system under win7 is runningProgramThe required DLL must be compiled by a 64-bit system, and vs2008 must also be installed with support for 64-bit compilation. If you have already selected this option during installation, you can install the conventional online approach to solve this problem. BOTH:

(1) Right-click the project name and click Properties. The project properties page is displayed. Find the linker ---- advanced, modify the target computer on the right, and select the option with x64.

(2) Right-click the project name, select the cleanup solution, select the x64 platform compiler, and then regenerate the solution to debug the program successfully.

2. If x64 cannot be found in the drop-down list of the selected platform, it indicates that 64-bit compilation is not supported in the system installation. Install x64 in the following way:

In the control panel add and delete programs, select vs2008, click Uninstall, and the repair option appears. Fix vs2008 to reinstall the plug-in, or directly install the file vs2008sp1chsx1512981. the following interface can be displayed after you reinstall ISO:

Select the red box in the figure.

3. If the problem persists, it is determined that the DLL file contained in the system is compiled under Win32, And the DLL must be compiled by a 64-bit system. For example, if opencv2.3.1 is compiled under Win32, you need to re-compile it. The specific steps are as follows:

(1) Run cmake2.8 and click Configure. In the displayed dialog box, select Visual Studio 9 2008.Win64Note that the 64-bit option is not mentioned during the introduction of opencv configuration. Visual Studio 9 2008 is selected by default, if the file with win64 is not selected, the file generated by make cannot be used. Select generate ".

(2) At this time, open opencv. sln and generate it under debug and release respectively,Select the x64 platform in the Configuration Manager.Otherwise, compiled files are still unavailable.

(3) After compilation, after the DLL and Lib paths are configured, the above errors will not occur again.

4. The solution is complete. If you have any questions, please leave a message.

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.