【解决方案】msys2 ucrt64 链接poco库时出现错误 undefined reference to `wWinMain‘

编程入门 行业动态 更新时间:2024-10-10 19:27:07

【解决方案】msys2 ucrt64 链接poco库时<a href=https://www.elefans.com/category/jswz/34/1771348.html style=出现错误 undefined reference to `wWinMain‘"/>

【解决方案】msys2 ucrt64 链接poco库时出现错误 undefined reference to `wWinMain‘

使用pacman安装了poco: ucrt64/mingw-w64-ucrt-x86_64-poco 1.11.6-2

CMakeLists.txt如下:

find_package(Poco REQUIRED Foundation Util Net)
set(ThirdLibs "Poco::Foundation;Poco::Util;Poco::Net")  # ${ThirdLibs} add_executable(test ${PROJECT_SOURCE_DIR}/src/test.cpp)
target_link_libraries(test ${ThirdLibs})

链接错误:

libmingw32.a(lib64_libmingw32_a-ucrtexewin.o): in function `wmain':
C:/M/B/src/mingw-w64/mingw-w64-crt/crt/ucrtexewin.c:67:(.text+0xa5): undefined reference to `wWinMain'
collect2.exe: error: ld returned 1 exit status

解决方案:修改主函数int main()int wWinMain(), 修改之后可顺利编译、运行。


感觉是pacman安装的这个poco的问题,因为链接opencv啥的都没问题。

更多推荐

【解决方案】msys2 ucrt64 链接poco库时出现错误 undefined reference to `wWinMain‘

本文发布于:2023-12-07 19:45:58,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1671675.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:出现错误   解决方案   链接   poco   reference

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!