Debugging program Problems

Source: Internet
Author: User

Many problems have occurred recently during program debugging.

1: error LNK2001: unresolved external symbol "void _ cdecl ErrDisplay (class CString &)"(? ErrDisplay @ YAXAAVCString @ Z) and so on. The compilation is successful and the function name is not found during connection, the possible problem is that a library file is written in c language or other languages, and the current project is a c ++ compiler.

2: another problem is that a class is defined, but the member functions of the class are accidentally commented out, resulting in a connection error.

3: another problem is that LNK4098: defaultlib "LIBCMT" conflicts with use of other libs; this is caused by inconsistent settings of each database, generally, the settings are consistent in project-setting-c ++-code.

4: Another one is error LNK2001: unresolved external symbol _ endthreadex. Set the thread to multiple threads.

5: mkl_c.lib: warning LNK4003: invalid library format; library ignored, error LNK2001: unresolved external symbol "void _ cdecl dgemv (char const *, int const *, int const *, double const *, double const *, int const *, double const *, int const *, double const *, double *, int const *)"(? Dgemv @ yaxpbdpbh1pbn212pan1 @ Z), started to think that it is caused by the first sentence mkl_c.lib being ignored. In fact, this is not the reason, because dgemv is compiled by c, the c ++ compiler is used here. The following is the first question.

6: error LNK2001: unresolved external symbol "void * _ cdecl operator new (unsigned int )"(??2 at YAPAXI@ Z) the error is a system error. solution:

1. Add the following two libraries to Configuration Properties> Linker> Input> Igonre Specific Library:
Nafxcwd. lib Libcmtd. lib

 

2. Configuration Properties-> Linker-> Command Line-> Addtional Option: append the two lib

Nafxcw. lib Libcmt. lib
It took me a lot of time to wait for errors like this.

 

7: error LNK2019: the external symbol "void _ cdecl ErrDisp (class ATL: CStringT <char, class StrTraitMFC_DLL <char, class ATL :: chTraitsCRT <char >> &)"(? ErrDisp @ YAXAAV? $ CStringT @ DV? $ StrTraitMFC_DLL @ DV? $ ChTraitsCRT @ D @ ATL @ Z), which is referenced in function _ main.

This problem is very strange, mainly because the CString class is used in the static library function, and the above problem occurs during the call. I checked a lot of information online and did not use it, after reading Microsoft's technical support, you can add the CString import template, and some others can add the cstring. h or atlstr. h is enough, but I tried it and still couldn't solve the problem. Finally, I converted all the cstrings into char *, in fact, the solution to this problem is to change the attribute-> Configuration Attribute-> General-> the use of MFC to "use the standard Windows library", and then recompile it. Supplement: I didn't see this problem during vc6 compilation. This problem occurs during vs2005 compilation. So I thought it was because of the parameter setting problem, so I tried a lot, finally, the problem is solved.

 

 

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.