[Solved] Undefined reference to main when compiling c++ [closed]


However, I do include a main class, in a class I call Hash.cpp

In C++, you need to have a main function, not class or a method in a class as it appears in other OOP languages.

That is the entry point for your program. That is not quite fair, since there is some preprocessing done for you where your main function is called, but that is your entry that you write.

The most trivial C++ program would like this:

int main() { return 0; }

If that bails out with the same error, it is likely that you are mixing up 32 and 64 bits in which case such issues can also occur with the “entry” point.

2

solved Undefined reference to main when compiling c++ [closed]