未定义引用的WinMain @ 16当编译SDL_ttf? [英] Undefined Reference to WinMain@16 When Compiling SDL_ttf?
问题描述
我试图编译SDL_ttf与MinGW和code :: Blocks的。我已经导入MSVC解决code :: Blocks的,有三个项目。
I am trying to compile SDL_ttf with MinGW and Code::Blocks. I have imported the MSVC Solution to Code::Blocks, There were three projects.
- SDL_ttf
- showfont
- glfont
添加SDL头的路径和 SDL.a
链接后编译罚款 SDL_ttf
项目。现在,每当我尝试编译 glfont
或 showfont
我得到:
the SDL_ttf
project compiled fine after adding the SDL headers to the path and linking with SDL.a
. Now whenever I try to compile glfont
or showfont
I get:
undefined reference to `WinMain@16`
从<一个href=\"http://wiki.libsdl.org/moin.cgi/FAQWindows#I_get_.22Undefined_reference_to_.27WinMain.4016.27.22\"相对=nofollow> SDL FAQ 我明白,当你不使用 SDLmain.a
可能会出现这个问题,所以我与它联系在一起,但我M仍然得到错误。有什么建议么?我完全失去了。
From the SDL FAQ I understood that this problem may occur when you do not link with SDLmain.a
, so I linked with it, but I'm still getting the error. Any suggestions? I'm completely lost.
推荐答案
这个问题似乎类似于您在MSVS遇到些什么,你必须声明的主要功能为:
The problem seems similar to something you encounter in MSVS, in that you have to declare the main function as:
int _tmain(int argc, _TCHAR* argv[])
或
int wmain(int argc, _TCHAR* argv[])
环境试图调用该函数,而不是的main()
因为你还没有实现它,会出现链接错误。
The environment tries to call this function and not main()
and since you haven't implemented it, the linking error occurs.
这篇关于未定义引用的WinMain @ 16当编译SDL_ttf?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!