Invalid Address specified to rtlvalidateheap

Source: Internet
Author: User

1. First, "Invalid Address specified to rtlvalidateheap
"

Found this article: http://hi.baidu.com/umu618/blog/item/d4e8242e424e3e564fc226d3.html

"One possible reason: C ++ classes are passed between different modules (projects), and the two modules use different Runtime Library settings. For example, the EXE module calls the DLL module to pass C ++ class functions, but the DLL module uses static links (release is multi-threaded (/mt)
Debug is multi-threaded debug (/MTD)
), While the EXE module uses dynamic links (release is multi-threaded DLL (/MD)
Debug is multi-threaded debug DLL (/MDD)
.

Compare the engineering properties of the two modules-C/C ++-code generation-Runtime Library
To see if the settings are the same. If they are different, change them to the same one. "

 

2. After changing the properties of my EXE project to the multi-threaded debug DLL (/MDD) with the same DLL,

Nafxcwd. Lib (appcore. OBJ): Error lnk2001: unresolved external symbol ___ argv

Find this article: Workshop:


"


1. [error message ]:
Libcmtd. Lib (crt0.obj): Error lnk2001: unresolved external symbol _ main

[Description]: Windows subsystems are used for Windows projects, rather than the Console
[Solution]: [project] --> [settings] --> select the "Link" property page,
Change/subsystem: console to/subsystem: Windows in project options.

2. [error message]: libcd. Lib (wincrt0.obj): Error lnk2001: unresolved external symbol

_ Winmain @ 16

 
[Description]: Console subsystems should be used for console projects, rather than Windows
[Solution]: [project] --> [settings] --> select the "Link" property page,
Change/subsystem: Windows to/subsystem: console in project options.

3. [error message]: msvcrtd. Lib (crtexew. OBJ): Error lnk2001: unresolved external symbol

_ Winmain @ 16

 
[Description]: Generally, the program entry function of the MFC project is winmain. If the Unicode version of the project is compiled, the program entry must be changed to wwinmaincrtstartup. Therefore, you need to reset the program entry.
[Solution]: [project] --> [settings] --> select the "C/C ++" attribute page,
In category, select output,
Enter wwinmaincrtstartup in entry-point symbol. 4. [error message ]:
Nafxcwd. Lib (thrdcore. OBJ): Error lnk2001: unresolved external symbol _ beginthreadex
Nafxcwd. Lib (thrdcore. OBJ): Error lnk2001: unresolved external symbol _ endthreadex
 
[Description]: this is because the Library [solution]: [project] --> [settings] --> select the "C/C ++" attribute page when MFC uses multiple threads,
In category, select code generation,
Select debug multithreaded or multithreaded in the use run-time library.
Where,
Single-threaded single-thread static link library (Release Version)
Multithreaded multi-thread static link library (Release Version)
Multithreaded DLL multi-thread dynamic link library (Release Version)
Debug single-threaded single-thread static link library (debug version)
Debug multithreaded multi-thread static link library (debug version)
Debug multithreaded DLL multi-thread dynamic link library (debug version)
Single thread: When multi-thread calling is not required, it is usually used in DOS environments.
Multithreading: Concurrent Operation
Static Library: link the library directly with the program and run it without the MFC library.
Dynamic library: The corresponding DLL dynamic library is required for the program to run.
Release Version: used for official release
Debug version: used during debugging. 5. [error prompt ]:
Compiling ..., error spawning cl.exe [description]: This question is very often caused by the question set by the compiler. The Compiler cl.exe "is used by VC to use the true Compiler (compiler), and its path is under" VC root directory/vc98/bin, you can find the application in the corresponding path.
[Solution]: "Tools"-> "option"-> "directories (directory) "reset the path of" excutable fils, include files, library files, source files. 6. [error message ]:
Nafxcw. Lib (appcore. OBJ): Error lnk2001: unresolved external symbol ___ argv

[Description ]:
[Solution]: Define _ afxdll7in Preprocessor. [error prompt]: Fatal error c1189: # error: please use the/MD switch for _ afxdll builds
[Description]: [solution]:/C ++-> code generation-> multithread DLL (Implementation/MD option)
"


Solution 6


3. A related question






Nafxcwd. Lib (dllmodul. OBJ): Error lnk2005: _ dllmain @ 12 already defined in utility. OBJ solution: (previous notes, forget some of the original posts)


1.



You only need to put

Win32, ndebug, _ WINDOWS, _ MBCS, _ usrdll, msgbox_exports, _ Windll, _ afxdll

In _ usrdll, delete, You can compile it correctly

 

Another description

Nafxcwd. Lib (dllmodul. OBJ): Error lnk2005: _ dllmain @ 12 already defined
Google hasn't done it for half a day
I had to do it myself, and finally remove the _ usrdll macro definition in the project. It's okay that the blind cat has reached the dead mouse.

A piece of code found in afx. h
# Ifdef _ usrdll
# Pragma comment (linker, "/include :__ afxforceusrdll ")
# Endif
I don't understand my current level. I'll take a look later!

 

2. linker tools error lnk2005 symbol already defined in object
The given symbol, displayed in its decorated form, was multiply defined. Tips
One of the following may be a cause:
The most common cause of this error is accidentally
Linking with both the single-threaded and multithreaded
Libraries. Ensure that the application project file
Primary des only the appropriate libraries and that any
Third-party libraries have appropriately created
Single-threaded or multithreaded versions.

The given symbol was a packaged function (created
Compiling with/Gy) and was encoded in more
One file but was changed between compilations. recompile
All files that include the symbol.
The
Given symbol was defined differently in two Member
Objects in different libraries, and both Member objects
Were used.

An absolute was defined twice, with a different value in each definition.

Linker tools error lnk1169 one or more multiply defined symbols found

The build failed due to multiple definitions of one
Or more symbols. This error is preceded by error
Lnk2005.

The/force or/Force: Multiple option overrides this error. 4. Official solution: http://support.microsoft.com/kb/148652/zh-cn

Lnk2005 error occurs when the CRT library and MFC library are connected in the wrong sequence in Visual C ++.

 

 

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.