E2474 'function' cannot be declared as static or inline (C++)

From RAD Studio
Jump to: navigation, search

Go Up to Compiler Errors And Warnings (C++) Index

You attempted to declare a symbol as static or inline and this type of symbol cannot be defined as static or inline. Certain functions, like 'main' and 'WinMain' cannot be declared static or inline. 'main' is the entrypoint of console applications, and 'WinMain' is the entry point of Windows applications.

For example, this error is displayed in the following cases:

static int main()  // This causes an error
{}

or

inline int main() { return 0; }