To solve it, you must call g like this: g main.cpp test.cpp -o main All it knows is that test.h declares a class called M圜lass, but it has no clue that its definition is inside test.cpp. The fact that files with the same name but different extension (like test.cpp and test.h) are related is very convenient for us programmers, but the compiler doesn't know it. Unfortunately, it is obvious to you but not to the compiler. You probably think that telling g to compile main.cpp is enough, because it includes test.h and obviously the definition of whatever is in test.h can be found in test.cpp. It is running the following command cd "c:\Users\drees\Desktop\TestRun\"
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |