I have a created a program starts with OS_main instead if int main
OS_MAIN()
{
// it is performing some function calls here
}
If i run my program : I am getting linker error as
LNK2019: unresolved external symbol_main referenced in function_tmainCRTStartup.
how to solve this error ??
I am using microsoft visual studio IDE.
Linker errors happen when the definition of a function or variable that is being used cannot be found. If you have this preprocessor definition somewhere...
#define OS_MAIN main
...and you're doing this...
int OS_MAIN(int argc, char *argv[])
{
return 0;
}
... that is fine, however, if you're using OS_MAIN
instead of main
that won't work. Every program needs a main
. That is where every program starts.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.