5

error LNK2019: 无法解析的外部符号 WinMain,error LNK2001: 无法解析的外部符号 Win...

 2 years ago
source link: https://blog.51cto.com/u_7265851/5080454
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

error LNK2019: 无法解析的外部符号 WinMain,error LNK2001: 无法解析的外部符号 WinMain

原创

​​​Debug版本:​​​

1>MSVCRTD.lib(exe_winmain.obj) : error LNK2019: 无法解析的外部符号 WinMain,该符号在函数 "int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ) 中被引用1>E:\worspace_Gis\qgis-3.10.0\dependency\SQLite3\x64\Debug\SQLite3d.exe : fatal error LNK1120: 1 个无法解析的外部命令

​​​Release版本:​​​

1>MSVCRT.lib(exe_winmain.obj) : error LNK2001: 无法解析的外部符号 WinMain1>E:\worspace_Gis\qgis-3.10.0\dependency\SQLite3\x64\Release\SQLite3.exe : fatal error LNK1120: 1 个无法解析的外部命令

error LNK2019: 无法解析的外部符号 WinMain,error LNK2001: 无法解析的外部符号 WinMain_无法解析的外部符号
error LNK2019: 无法解析的外部符号 WinMain,error LNK2001: 无法解析的外部符号 WinMain_error LNK2001_02

二、问题原因

根据输出提示可以发现是无法解析到​​WinMain​​函数,而我们又知道​WinMain​函数是​windows​窗口程序的入口点,而我们编写的程序是控制台程序,应该是是我们工程属性设置错误。

三、解决办法

       Visual Studio的资源管理器窗口中选中发生错误的工程,右键选择属性菜单,弹出如下所示的​​属性设置窗口,选择链接器,子系统​​;然后依据错误的具体信息选择对应的子系统即可。

error LNK2019: 无法解析的外部符号 WinMain,error LNK2001: 无法解析的外部符号 WinMain_error LNK2019_03

如果您觉得文章对您有用,记得​点赞收藏哦​!谨防丢失!

  • 打赏
  • 1
  • 收藏
  • 评论
  • 分享
  • 举报

Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK