2
/** converts 'WinMain' to the traditional 'main' entrypoint **/
#define PRO_MAIN(argc, argv)\
int __main (int, LPWSTR*, HINSTANCE, int);\
int WINAPI WinMain (HINSTANCE __hInstance, HINSTANCE __hPrevInstance, \
LPSTR __szCmdLine, int __nCmdShow)\
{\
int nArgs;\
LPWSTR* szArgvW = CommandLineToArgvW (GetCommandLineW(), &nArgs);\
assert (szArgvW != NULL);\
return __main (nArgs, szArgvW, __hInstance, __nCmdShow);\
}\
\
int __main (int __argc, LPWSTR* __argv, HINSTANCE __hInstance, int __nCmdShow)
现在,当我使用这个代码在这里:奇怪的错误的main()宏
PRO_MAIN(argc, argv)
{
...
}
我得到的错误:
error: conflicting types for '__main'
note: previous declaration of '__main' was here
什么问题?
什么位置信息与“note:”行关联?另外,你是否考虑过这个笔记告诉你的是什么? – geekosaur 2012-04-25 03:47:28
你也可以完全不用“WinMain”,使用'main',并明确地告诉链接器你想要一个'SUBSYSTEM:WINDOWS'程序。 – jamesdlin 2012-04-25 03:51:09
@jamesdlin谢谢。虽然与问题无关,但这几乎解决了我的项目的所有问题。但是我不会遇到任何问题吗? – ApprenticeHacker 2012-04-25 04:07:06