1 Many compilers display errors, not the line, but the previous line of errors (see a few lines before and after the error can generally find the problem)
2 General report a bunch of mistakes, find the first error changed and then edit Log
If this error occurs, you should first see whether the "#include" statement contains, or is included, correctly. Symbols cannot be resolved means that the compiler knows that there is a symbol exists, that is, there is a declaration, but in the link, can not find the implementation code, then go to see if the error of the function is not implemented code. If they do already have the error, recompile them.
Depending on the record of the individual encountering this error, the reason can be divided into several:
Reason one: only in. h declared a method, not in the CPP implementation.
Specifically, sometimes in the header file to clear the need for the method, really forgot to implement in the source file;
Sometimes in the header file to clear the required method, in the source file implementation of the method, but left the method name before the "ClassName::";
Sometimes the required method is declared and implemented in the header file, but when the code is adjusted to copy the method directly to the source file, it does not add "ClassName::" Before the function.
Reason two: Both declarations and implementations are available, but they are not added to the project directory of VS, and this error occurs if referenced in other. cpp.
Specifically, when you import your own previous code or other existing code, and you copy it to the target folder under the project, sometimes you forget or omit to add the files under the project directory of VS, which can cause this error.
Reason three: Sometimes the project is relatively large, will directly add some of the original basic engineering to submit efficiency, if the original project is not too familiar with the project to include the same name of the file or class, the same will cause this problem.
The specific reason for this is that an intermediate file with the same name will appear at compile time because the compilation is sequential and a file substitution occurs, causing a connection problem to occur when other files refer to the replaced file.
Reason four: inline function related, if the declaration of the inline function in the header file, implemented in the source file, this time if the other class contains only the header file, this problem will also occur when calling this inline function. This will solve the problem by putting the function implementation in the header file, or by include the. cpp.
Reason five: If this class is a class defined in a dynamic library, it may be because the. lib file that corresponds to this dynamic library is not added to the project.
Original address: http://blog.csdn.NET/tobefxz/article/details/22154469
Copyright NOTICE: This article is the original article of the blogger, without the permission of the blogger may not be reproduced. In case of doubt, the comments will give a reply. "Eat conscience, pull the mind" http://blog.csdn.net/Taily_Duan/article/details/53692274