Compiling Warning Error C4008 Main Inline Attribute Ignored

Hi. I am new to C++ and have made a program which compiles fine, but generates the following warning message:

1>g:\assessment3\listoftownsmain.cc(27) : warning C4008: 'main' : 'inline' attribute ignored

I would be grateful if anyone can explain what this error is about. In case this helps when I click on the line concerned it shows the main inline has been defined as:

1
2
inline int main(void)
{


Is this the correct way to define the main or is there something wrong?

Many thanks.
I don't really know anything about inline functions, so I suggest you check these out, they are about inline functions and inline expansion:

http://en.wikipedia.org/wiki/Inline_function

http://en.wikipedia.org/wiki/Inline_expansion

Usually though, just use int main ().
It's not an error. Your compiler is basically telling you "STFU, I'm not making main inline no matter how much you beg me". It's btw completely pointless to declare main as inline.
Thank you. I removed the word inline which has removed the warning message.
Quote from the C++ standards document:
A program that declares main to be inline or static is ill-formed.
Topic archived. No new replies allowed.