MFC simulation settings

Source: Internet
Author: User
Today, I encountered a lot of problems when compiling the hello MFC example in "getting down to MFC". Now I want to take a note of my problems. After you break the code in the book into the computer and run it: Problem 1: nmake is not an internal command solution: add c to the path of the environment variable: \ Program Files \ Microsoft Visual Studio \ vc98 \ bin. Of course, this value is changed Based on the installation directory of your vc6. Question 2: Fatal error u1033: syntax error: 'Unexpected stopSolution: link.exe in the hello.makfile cannot be written in the top frame, but it must be at least empty. The reason is not clear. Problem 3: Fatal error u1007: Double quotation mark not allowed in Name stop.Solution: At the same time, there must be spaces before cl.exe‑rc.exe. The format of the sample is incorrect. The prompt is incorrect. The prompt is "no language" .....and the first line of hello.exe must be written in the top level. Otherwise, an error will be prompted .... Question 4: the pop-up dialog box "mspdb60.dll is not found, so this application cannot be started. Re-installing the application may fix this issue ". The following error is displayed in DOS: nmake: Fatal error u1077: 'cl.exe ': return code '0xc0000135' stop. solution: add c: \ Program Files \ Microsoft Visual Studio \ common \ msdev98 \ bin to the environment variable path. Note that you need to restart the MS-DOS after modifying the environment variable, otherwise, it cannot take effect.

Question 5: stdafx. H (4): Fatal error c1034: afxwin. H: No include path set
Nmake: Fatal error u1077: 'cl.exe ': return code '0x2'
Stop.
Solution: The following three include directories are set in environment variables because no include path exists.
C: \ Program Files \ Microsoft Visual Studio \ vc98 \ include
C: \ Program Files \ Microsoft Visual Studio \ vc98 \ MFC \ include
C: \ Program Files \ Microsoft Visual Studio \ vc98 \ ATL \ include

Question 6: Hello. H (4): Error c2555: 'cmywinapp: initinstance': overriding virtual functio
N differs from 'cwinapp: initinstance' only by return type or calling convention
Solution: It turns out that bool in the cmywinapp: initinstance Declaration uses lower-case letters. during compilation, it is considered different from the initinstance function declaration of the base class. It can be changed to uppercase.

Question 7: resource. H (2): Fatal error rc1004: unexpected end of file found
Solution: Download a source code on the Internet, and copy the end of a file after comparison. Of course, you must copy the jjhour. ICO file to the project directory. Otherwise, an error occurs. This icon is available in the source code on the Internet.

Problem 8: Link: Fatal error lnk1104: cannot open file "mfc42.lib"
Solution: it is finally the turn to set the lib directory. Set the following two lib directories in the environment variables:
C: \ Program Files \ Microsoft Visual Studio \ vc98 \ Lib
C: \ Program Files \ Microsoft Visual Studio \ vc98 \ MFC \ Lib

Success !!

From: http://blog.sina.com.cn/s/blog_4c09b6a801000844.html

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.