青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

[轉載]VC++常見錯誤

Visual C++ Error Messages

This page contains a listing of "difficult to diagnose" error messages and possible fixes. I haven't taught a programming class that uses Visual C++ in several years so this list is probably out of date by now.  It was valid for Microsoft Visual C++ version 6.0 service pack 3.

 

C1001: INTERNAL COMPILER ERROR (compiler file 'msc1.cpp', line 1786) Please choose the Technical Support command on the Visual C++ Help menu, or open the Technical Support help file for more information

This error results from leaving off the parentheses immediately following the function name in a function header.  To correct the error simply add () to the end of the function name.

 

C1010: unexpected end of file while looking for precompiled header directive

If your project is an MFC AppWizard created project then this error results from not #including StdAfx.h as the first include statement (before any other includes, data declarations, or executable program code).

 

C1083: Cannot open precompiled header file: 'Debug/<Project-Name>.pch': No such file or directory

This error results from a missing file - the compiled version of StdAfx.cpp. Visual C++ does a poor job of keeping track of this file and frequently "forgets" how to build it. This problem often occurs after restoring a saved workspace from diskette without the Debug directory. To fix the error select StdAfx.cpp from the workspace file list them choose Compile from the Build menu.  If that doesn't work the go to Project -> Settings, select the C/C++ tab, and click the radio button labeled Create Precompiled Headers.

 

C2001: newline in constant

This error is usually caused by a string or character constant that is missing its closing ' or " symbol.

C2065: '<data-member name>' : undeclared identifier

If this error occurs in one of your member functions then it is generally the result of forgetting the class scope operator in front of the function name in your .cpp file.

 

C2143: syntax error : missing ';' before 'PCH creation point'

Check each of the include files to ensure that the closing brace of each class declaration is followed by a semicolon.

 


C2143: syntax error : missing ';' before '*'

If this error is followed by two C2501 errors then the problem is an undeclared class name within a pointer declaration.

For example, the declaration:

CClass *pObject;

will generate the above error message followed by a C2501 error message for 'CClass' and another C2501 message for 'pObject'.  The problem is that the compiler isn't recognizing CClass as a valid class/type name.  To correct the problem add a i nclude of the file containing the declaration of CClass (e.g., i nclude CClass.h)

 

C2447: missing function header (old-style formal list?)

This error usually results from a missing { or use of a ; instead of a { following the parameter list of a function header.

 

C2511: '<function-name>' : overloaded member function not found in '<class-name>'

This error results from a mismatch in the parameter list of a member function declaration (.h file) and definition (.ccp file). Check the forward declaration of the function in the .h file and its definition in the .cpp file and ensure that the number of parameters and the type of each parameter match exactly.

C2512: '<constructor-function-name>' : no appropriate default constructor available

This error usually occurs when you implement the constructor function of a derived class and forget to include parameter passing to the base class constructor function.   For example assume that CDerived is derived from CBase and that the CBase constructor function requires one parameter (e.g., int A).  If you define the CDerived constructor function as:

CDerived::CDerived(int A, int B) { ... }

the compiler will issue the above error message on the line containing the function header of CDerived::CDerived() because you haven't provided instructions for routing the parameter A to CBase::CBase().  Because you didn't provide instructions the compiler assumes that CBase::CBase() requires no arguments and it complains because no version of CBase::CBase() has been defined that accepts zero arguments.

If you intended to provide a version of CBase::CBase() that requires no arguments then the error message indicates that you forgot to declare that function in your base class declaration (e.g., in CBase.h).

If CBase::CBase() does require one or more arguments then you must correct the problem by including explicit instructions for passing parameters from the derived class constructor function to the base class constructor function.  The correction for the example above is:

CDerived::CDerived(int A, int B) : CBase(A) { ... }

 

C2556: '<function-name>' : overloaded functions only differ by return type
C2371: '<function-name>' : redefinition; different basic types

These errors usually result from a mismatch of function type between a .h and .cpp file. Check the forward declaration of the function in the .h file and its definition in the .cpp file and make the function return type identical in both files.

 

C2601: '<function-name>' : local function definitions are illegal

This error results from defining one function inside the body of another function.   It usually means that you omitted one or more } symbols in the function just before the function named in the error message.

C2653: '<Class-Name>' : is not a class or namespace name

This error usually results from not having include "StdAfx.h" as the first include statement in your class.cpp file.  It can also occur if your class definition is in a .h file and you forget to include that .h file in another file that refers to the class name.

 

C2661: '<Class-Name>::<Function-Name>' : no overloaded function takes n parameters

This error indicates a mismatch between the parameters used in a function call (e.g., from main.cpp) and the declaration of the function.  The function call is passing n parameters and there is no function declaration that uses that number of parameters.

 

LNK1104: Cannot open file nafxcwd.lib

This error sometimes occurs when a project uses a class from the MFC but the project settings don't explicitly tell the link editor to look in the MFC libraries. 

Go to Project --> Settings (Build --> Settings in Visual C++ 4.0). On the General tab check the box that says "Use MFC in a Shared DLL".

 

LNK1168: cannot open Debug\<Project-Name>.exe for writing

This error occurs when the link editor attempts to write to a .exe file that is currently in use. The .exe file of an executing program is write protected until the program is terminated. Look at the status bar at the bottom of your screen and find the icon representing your executable application. Open the application and exit from it. Then select Build.

 

LNK2001: unresolved external symbol __endthreadex
LNK2001: unresolved external symbol __beginthreadex

These errors result from using an MFC object or function without telling the link editor to search the MFC libraries.

Go to Project --> Settings (Build --> Settings in Visual C++ 4.0). On the General tab check the box that says "Use MFC in a Shared DLL".

LNK2001: unresolved external symbol _main

Your project doesn't contain a function called main().  The error usually results from forgeting to add main.cpp to the project workspace.

 

<File>.obj : error LNK2001: unresolved external symbol "public: void __thiscall <Class1>::<Function1>(<Type>)"

This a generic form of a LNK2001 error where <File>.obj can be any object file in your project and <Class1>::<Function1>(<Type>) can be any function in any class.  Substitute the specific <File>, <Class>, <Function>, and <Type> in your message into the instructions below to diagnose and correct the problem.

An LNK2001 error means that the link editor is looking for a compiled function and can't find it.  The call to the "missing function" is somewhere in <File>.cpp. Unfortunately, double-clicking on the error message won't take you to the point in <File.cpp> where the function is called but you can search for it with Find or Find In Files.  The function the link editor can't find is a member of <Class>, its name is <Function1>, and its return type is <Type>.

There are two common reasons for a LNK2001 error:

1.        The call in <File>.cpp doesn't match the function prototype in <Class>.h and/or the implementation in <Class>.cpp.  The mismatch may be in the function name, return type, or number and/or type of parameters.   Correction strategies include:

o        Check that the function name is spelled the same (case sensitive) in all three files (File.cpp, Class.h, and Class.cpp).

o        Check that the function is actually declared and defined within <Class> - perhaps you defined it as a member of a different class or perhaps you tried to call the function (in <File>.cpp) using an object or object pointer of a different class.

o        Check that the number and type of parameters in the function implementation (in <Class>.cpp) matches the number and type of parameters declared in the function declaration in <Class>.h.

o        Check that the number and type of parameters in the function call (in <File>.cpp) matches the number and type of parameters declared in the function header in <Class>.cpp.

2.        The function was never declared or was declared but never defined.  To see if either is the case go to the ClassView window of the Workspace view.  Click the + next to <Class> and find <Function> in the list of member functions.

o        If <Function> is NOT in the list then it was never declared or defined - add a declaration to the class declaraion in <Class>.h and implement the function in <Class>.cpp.

If <Function> is in the list then right click on it and select Go To Definition from the pop-up menu.  If you get the error message Cannot find definition (implementation) of this function then the function was declared but never defined (implemented).  Implement the function to

o        <Class>.cpp.

 

LNK2005: <some-long-string-of-mostly-garbage> already defined in <name>.lib(<name>.obj)

This error usually results from including a source code file multiple times. If you recognize any of the names in the message then it probably results from multiple inclusion of one of your own header files. Check to be sure that you've used #ifndef/#define/#endif properly your header files. If you don't recognize the name then it's probably multiple inclusion of a system file (e.g., afxwin.h). Make sure that you haven't explicitly included something in main.cpp that is already included in one of your own header files.   Also check that you haven't included a .cpp file where you should have included a .h file

posted on 2007-04-15 21:24 ashura 閱讀(2320) 評論(0)  編輯 收藏 引用 所屬分類: Computer Science

<2007年4月>
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345

導航

統計

常用鏈接

留言簿(2)

隨筆分類

隨筆檔案

文章分類

文章檔案

搜索

最新評論

閱讀排行榜

評論排行榜

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            久久免费视频在线观看| 最新日韩在线视频| 久久只有精品| 宅男噜噜噜66一区二区66| 久久亚洲高清| 激情成人亚洲| 久久精品国产精品亚洲| 中文av一区特黄| 欧美日韩不卡合集视频| 亚洲欧洲视频| 亚洲精品麻豆| 欧美日韩国产成人在线免费| 亚洲乱码国产乱码精品精98午夜 | 亚洲欧美韩国| 在线亚洲自拍| 国产毛片一区| 欧美在线观看你懂的| 亚洲视频在线免费观看| 国产精品国产| 欧美中文在线观看国产| 欧美专区第一页| 狠狠久久婷婷| 欧美激情国产高清| 欧美高清视频一区二区| 亚洲精品一区二区三区99| 亚洲啪啪91| 欧美视频在线看| 欧美亚洲综合网| 久久精品视频在线免费观看| 亚洲国产经典视频| 99av国产精品欲麻豆| 国产精品sm| 久久久国产精品一区| 久久久精品国产免大香伊| 西西人体一区二区| 在线看片日韩| 亚洲九九精品| 国产精品一香蕉国产线看观看 | 欧美不卡高清| 欧美日韩成人激情| 欧美在线观看视频| 美女尤物久久精品| 午夜精品影院在线观看| 久久精品一区中文字幕| 日韩视频免费| 亚洲在线网站| 亚洲日本视频| 亚洲欧美日韩直播| 91久久精品美女高潮| 亚洲视频欧美在线| 亚洲第一偷拍| 亚洲自拍偷拍麻豆| 亚洲久久一区| 久久久久国产一区二区三区| 中日韩视频在线观看| 欧美一区二区三区在线观看视频| 亚洲国产精品女人久久久| 亚洲午夜精品久久| 亚洲区中文字幕| 午夜久久资源| 亚洲网站视频福利| 麻豆乱码国产一区二区三区| 亚洲免费中文| 欧美激情第六页| 久久亚洲国产成人| 国产精品美腿一区在线看| 亚洲国产精品电影| 国产一区二区三区在线观看免费| 最近中文字幕日韩精品 | 欧美日韩在线另类| 老司机午夜精品视频| 国产精品无人区| 日韩视频免费观看| 亚洲日本理论电影| 久久亚洲视频| 另类春色校园亚洲| 国产欧美日韩激情| 亚洲午夜一区二区| 亚洲一区二区免费| 欧美日韩美女| 日韩视频一区| 中日韩高清电影网| 欧美啪啪一区| 亚洲欧洲精品一区二区三区不卡 | 国内一区二区三区| 亚洲永久精品大片| 亚洲一区在线观看免费观看电影高清 | 免费在线观看一区二区| 亚洲欧美韩国| 亚洲制服欧美中文字幕中文字幕| 欧美人与性禽动交情品| 亚洲欧洲精品一区二区三区 | 国产精品日韩欧美一区| 亚洲精品久久久一区二区三区| 亚洲欧洲精品天堂一级| 麻豆成人综合网| 欧美大片免费观看在线观看网站推荐| 极品尤物av久久免费看| 久久一日本道色综合久久| 免费短视频成人日韩| 怡红院精品视频| 免费成人av在线看| 欧美刺激性大交免费视频| 亚洲国产精品悠悠久久琪琪| 男女精品视频| 亚洲毛片在线看| 亚洲免费在线观看| 国产午夜精品理论片a级探花| 午夜精品成人在线| 免费看av成人| 一本久久a久久免费精品不卡| 欧美四级在线观看| 先锋亚洲精品| 亚洲国产精品精华液网站| 亚洲靠逼com| 国产精品资源在线观看| 久久久久久高潮国产精品视| 欧美高清在线一区| 亚洲一区二区三区成人在线视频精品| 国产精品日日做人人爱| 久久精品99国产精品| 欧美肥婆在线| 亚洲欧美日韩国产综合精品二区| 国产农村妇女精品| 久久午夜精品| 一区二区冒白浆视频| 久久这里只有精品视频首页| 9人人澡人人爽人人精品| 国产人久久人人人人爽| 蜜桃久久精品乱码一区二区| 99av国产精品欲麻豆| 久久综合久久综合久久| 亚洲特色特黄| 在线电影国产精品| 国产精品国产精品| 蜜桃久久av一区| 亚洲综合日韩在线| 亚洲韩国青草视频| 久久精品99国产精品酒店日本| 亚洲国产高清高潮精品美女| 国产精品亚洲片夜色在线| 欧美freesex交免费视频| 亚洲与欧洲av电影| 亚洲精品少妇网址| 免费视频最近日韩| 久久av老司机精品网站导航| 一区二区三区国产| 亚洲国产精品一区在线观看不卡| 国产精品一二| 欧美激情网友自拍| 久久久久国色av免费看影院 | 香港久久久电影| 亚洲精品在线电影| 嫩草国产精品入口| 1769国产精品| 国产精品亚洲不卡a| 欧美啪啪一区| 欧美国产成人在线| 玖玖玖国产精品| 欧美在线黄色| 午夜精品久久久久久久久久久久久 | 亚洲国产精品一区二区www| 国产美女搞久久| 欧美手机在线| 欧美视频国产精品| 欧美精品一区视频| 欧美高清不卡| 欧美日本国产精品| 欧美国产极速在线| 久久国产精品一区二区| 性色av一区二区三区在线观看| 一区二区三区 在线观看视| 亚洲人久久久| 亚洲精品久久久久中文字幕欢迎你| 欧美国产精品v| 欧美国产日产韩国视频| 欧美成人一区二免费视频软件| 性色av一区二区三区| 午夜精品久久久久久久99樱桃| 亚洲欧美国内爽妇网| 亚洲欧美国产一区二区三区| 亚洲欧美日韩中文在线制服| 亚洲视频中文| 亚洲欧美视频一区| 久久激情五月丁香伊人| 欧美中在线观看| 久久久www| 女人香蕉久久**毛片精品| 开心色5月久久精品| 欧美大色视频| 亚洲精品激情| 国产精品99久久不卡二区| 亚洲午夜久久久久久尤物| 午夜精品久久久久久久白皮肤| 欧美影片第一页| 麻豆亚洲精品| 国产精品国色综合久久| 国产无一区二区| 亚洲精品欧美日韩专区| 亚洲女同精品视频|