There are 2 files: Element.cpp and Element.h .
In main.cpp I connect Element.h . But how does the compiler know when and where to attach the Element.cpp file in which the implementation is stored? After all, I do not prescribe it anywhere.
The compiler does not know. When compiling, it specifies which .срр files to compile, for example
g++ file1.cpp file2.cpp and in all .cpp files you need to specify the necessary header files. If you are working in the IDE, then the compiler will automatically transfer the source code files that are included in the project.
unresolved external symbol build error unresolved external symbol - Yuriy Orlov.lib , .so , etc.), then the compilation and build will take place in exactly the same way, only the main functions should not be because the library will be included in the executable file, and if it is present, 2 entry points will be detected that is unacceptable. - Yuriy OrlovSource: https://ru.stackoverflow.com/questions/501042/
All Articles