您的位置:首页 > 大数据 > 人工智能

当创建SDL工程发现“无法解析的外部符号 _SDL_main”出错

2017-07-04 20:53 281 查看
当你创建一个新控制台程序,想调用SDL时,编译时发现如下出错:
1>------ 已启动生成: 项目: caipal, 配置: Debug Win32 ------
1>  caipal.cpp
1>SDLmain.lib(SDL_win32_main.obj) : error LNK2019: 无法解析的外部符号 _SDL_main,该符号在函数 _main 中被引用
1>E:\game\caipal\src\..\bin\caipalD.exe : fatal error LNK1120: 1 个无法解析的外部命令
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========

这时,其实是main函数定义与sdl库里的不一样,比如:
int main()

这时编译时,就会出现上面的出错。需要修改为这样:
int main(int      argc, char    *argv[])

就没有这个出错了。

1. RPG游戏从入门到精通

http://edu.csdn.net/course/detail/5246

2. WiX安装工具的使用http://edu.csdn.net/course/detail/5207

3. 俄罗斯方块游戏开发
http://edu.csdn.net/course/detail/5110
4. boost库入门基础
http://edu.csdn.net/course/detail/5029
5.Arduino入门基础
http://edu.csdn.net/course/detail/4931
6.Unity5.x游戏基础入门
http://edu.csdn.net/course/detail/4810
7. TensorFlow API攻略
http://edu.csdn.net/course/detail/4495
8. TensorFlow入门基本教程
http://edu.csdn.net/course/detail/4369
9. C++标准模板库从入门到精通 
http://edu.csdn.net/course/detail/3324
10.跟老菜鸟学C++
http://edu.csdn.net/course/detail/2901
11. 跟老菜鸟学python
http://edu.csdn.net/course/detail/2592
12. 在VC2015里学会使用tinyxml库
http://edu.csdn.net/course/detail/2590
13. 在Windows下SVN的版本管理与实战 
http://edu.csdn.net/course/detail/2579
14.Visual Studio 2015开发C++程序的基本使用 
http://edu.csdn.net/course/detail/2570
15.在VC2015里使用protobuf协议
http://edu.csdn.net/course/detail/2582
16.在VC2015里学会使用MySQL数据库
http://edu.csdn.net/course/detail/2672

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  vc C++ sdl
相关文章推荐