当前位置: 首页 > web >正文

【libuv】基于libuv的exe链接错误

vs2017构建 基于libuv的exe链接错误

1>libuv.lib(util.obj) : error LNK2019: unresolved external symbol __imp__GetAdaptersAddresses@20 referenced in function _uv_interface_addresses
1>libuv.lib(util.obj) : error LNK2019: unresolved external symbol __imp__GetUserProfileDirectoryW@12 referenced in function _uv__getpwuid_r
1>libuv.lib(process.obj) : error LNK2019: unresolved external symbol __imp__SymSetOptions@4 referenced in function _uv__kill
1>libuv.lib(process.obj) : error LNK2019: unresolved external symbol __imp__SymGetOptions@0 referenced in function _uv__kill
1>libuv.lib(process.obj) : error LNK2019: unresolved external symbol _MiniDumpWriteDump@28 referenced in function _uv__kill
1>D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\echo.exe : fatal error LNK1120: 5 unresolved externals

你遇到的错误是 链接器错误(LNK2019),表示你的程序在链接阶段找不到某些 Windows API 函数的实现。这些函数来自于系统的动态链接库(DLL),需要显式链接相应的库文件。下面是每个未解析符号及其对应的 Windows 库:


🔧 错误详解与解决方案

1. __imp__GetAdaptersAddresses@20
  • ✅ 需要链接库:Iphlpapi.lib
2. __imp__GetUserProfileDirectoryW@12
  • ✅ 需要链接库:Userenv.lib
3. __imp__SymSetOptions@4
4. __imp__SymGetOptions@0
  • ✅ 需要链接库:Dbghelp.lib
5. _MiniDumpWriteDump@28
  • ✅ 需要链接库:Dbghelp.lib

解决方法

你需要在链接设置中加入这些库,可以通过以下方式之一实现:

方法一:在 Visual Studio 中设置
  1. 打开项目属性。

  2. 选择:

    • 配置属性 → 链接器 → 输入 → 附加依赖项(Additional Dependencies)
  3. 添加以下内容:

    Iphlpapi.lib
    Userenv.lib
    Dbghelp.lib
    

    每个库用换行或分号隔开。


方法二:在代码中通过 #pragma 添加(不推荐用于大型项目)
#pragma comment(lib, "Iphlpapi.lib")
#pragma comment(lib, "Userenv.lib")
#pragma comment(lib, "Dbghelp.lib")

🔍 补充建议

  • 确保使用的 Windows SDK 安装完整,尤其是 DbgHelp 和 Userenv。
  • 如果你是用 CMake 构建项目,确保 target_link_libraries 中添加了这些库。

我的exe链接成功

Build started at 0:00...
1>------ Build started: Project: echo, Configuration: Debug Win32 ------
1>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2189,5): warning MSB9008: The referenced project ..\..\project\razor.vcxproj does not exist.
1>x265-static.lib(analysis.obj) : warning LNK4099: PDB 'encoder.pdb' was not found with 'x265-static.lib(analysis.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\encoder.pdb'; linking object as if no debug info
1>x265-static.lib(search.obj) : warning LNK4099: PDB 'encoder.pdb' was not found with 'x265-static.lib(search.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\encoder.pdb'; linking object as if no debug info
1>x265-static.lib(bitcost.obj) : warning LNK4099: PDB 'encoder.pdb' was not found with 'x265-static.lib(bitcost.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\encoder.pdb'; linking object as if no debug info
1>x265-static.lib(motion.obj) : warning LNK4099: PDB 'encoder.pdb' was not found with 'x265-static.lib(motion.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\encoder.pdb'; linking object as if no debug info
1>x265-static.lib(slicetype.obj) : warning LNK4099: PDB 'encoder.pdb' was not found with 'x265-static.lib(slicetype.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\encoder.pdb'; linking object as if no debug info
1>x265-static.lib(frameencoder.obj) : warning LNK4099: PDB 'encoder.pdb' was not found with 'x265-static.lib(frameencoder.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\encoder.pdb'; linking object as if no debug info
1>x265-static.lib(framefilter.obj) : warning LNK4099: PDB 'encoder.pdb' was not found with 'x265-static.lib(framefilter.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\encoder.pdb'; linking object as if no debug info
1>x265-static.lib(level.obj) : warning LNK4099: PDB 'encoder.pdb' was not found with 'x265-static.lib(level.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\encoder.pdb'; linking object as if no debug info
1>x265-static.lib(nal.obj) : warning LNK4099: PDB 'encoder.pdb' was not found with 'x265-static.lib(nal.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\encoder.pdb'; linking object as if no debug info
1>x265-static.lib(sei.obj) : warning LNK4099: PDB 'encoder.pdb' was not found with 'x265-static.lib(sei.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\encoder.pdb'; linking object as if no debug info
1>x265-static.lib(sao.obj) : warning LNK4099: PDB 'encoder.pdb' was not found with 'x265-static.lib(sao.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\encoder.pdb'; linking object as if no debug info
1>x265-static.lib(entropy.obj) : warning LNK4099: PDB 'encoder.pdb' was not found with 'x265-static.lib(entropy.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\encoder.pdb'; linking object as if no debug info
1>x265-static.lib(dpb.obj) : warning LNK4099: PDB 'encoder.pdb' was not found with 'x265-static.lib(dpb.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\encoder.pdb'; linking object as if no debug info
1>x265-static.lib(ratecontrol.obj) : warning LNK4099: PDB 'encoder.pdb' was not found with 'x265-static.lib(ratecontrol.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\encoder.pdb'; linking object as if no debug info
1>x265-static.lib(reference.obj) : warning LNK4099: PDB 'encoder.pdb' was not found with 'x265-static.lib(reference.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\encoder.pdb'; linking object as if no debug info
1>x265-static.lib(encoder.obj) : warning LNK4099: PDB 'encoder.pdb' was not found with 'x265-static.lib(encoder.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\encoder.pdb'; linking object as if no debug info
1>x265-static.lib(api.obj) : warning LNK4099: PDB 'encoder.pdb' was not found with 'x265-static.lib(api.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\encoder.pdb'; linking object as if no debug info
1>x265-static.lib(weightPrediction.obj) : warning LNK4099: PDB 'encoder.pdb' was not found with 'x265-static.lib(weightPrediction.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\encoder.pdb'; linking object as if no debug info
1>x265-static.lib(asm-primitives.obj) : warning LNK4099: PDB 'common.pdb' was not found with 'x265-static.lib(asm-primitives.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\common.pdb'; linking object as if no debug info
1>x265-static.lib(vec-primitives.obj) : warning LNK4099: PDB 'common.pdb' was not found with 'x265-static.lib(vec-primitives.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\common.pdb'; linking object as if no debug info
1>x265-static.lib(dct-sse3.obj) : warning LNK4099: PDB 'common.pdb' was not found with 'x265-static.lib(dct-sse3.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\common.pdb'; linking object as if no debug info
1>x265-static.lib(dct-ssse3.obj) : warning LNK4099: PDB 'common.pdb' was not found with 'x265-static.lib(dct-ssse3.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\common.pdb'; linking object as if no debug info
1>x265-static.lib(dct-sse41.obj) : warning LNK4099: PDB 'common.pdb' was not found with 'x265-static.lib(dct-sse41.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\common.pdb'; linking object as if no debug info
1>x265-static.lib(primitives.obj) : warning LNK4099: PDB 'common.pdb' was not found with 'x265-static.lib(primitives.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\common.pdb'; linking object as if no debug info
1>x265-static.lib(pixel.obj) : warning LNK4099: PDB 'common.pdb' was not found with 'x265-static.lib(pixel.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\common.pdb'; linking object as if no debug info
1>x265-static.lib(dct.obj) : warning LNK4099: PDB 'common.pdb' was not found with 'x265-static.lib(dct.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\common.pdb'; linking object as if no debug info
1>x265-static.lib(lowpassdct.obj) : warning LNK4099: PDB 'common.pdb' was not found with 'x265-static.lib(lowpassdct.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\common.pdb'; linking object as if no debug info
1>x265-static.lib(ipfilter.obj) : warning LNK4099: PDB 'common.pdb' was not found with 'x265-static.lib(ipfilter.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\common.pdb'; linking object as if no debug info
1>x265-static.lib(intrapred.obj) : warning LNK4099: PDB 'common.pdb' was not found with 'x265-static.lib(intrapred.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\common.pdb'; linking object as if no debug info
1>x265-static.lib(loopfilter.obj) : warning LNK4099: PDB 'common.pdb' was not found with 'x265-static.lib(loopfilter.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\common.pdb'; linking object as if no debug info
1>x265-static.lib(constants.obj) : warning LNK4099: PDB 'common.pdb' was not found with 'x265-static.lib(constants.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\common.pdb'; linking object as if no debug info
1>x265-static.lib(cpu.obj) : warning LNK4099: PDB 'common.pdb' was not found with 'x265-static.lib(cpu.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\common.pdb'; linking object as if no debug info
1>x265-static.lib(version.obj) : warning LNK4099: PDB 'common.pdb' was not found with 'x265-static.lib(version.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\common.pdb'; linking object as if no debug info
1>x265-static.lib(threading.obj) : warning LNK4099: PDB 'common.pdb' was not found with 'x265-static.lib(threading.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\common.pdb'; linking object as if no debug info
1>x265-static.lib(threadpool.obj) : warning LNK4099: PDB 'common.pdb' was not found with 'x265-static.lib(threadpool.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\common.pdb'; linking object as if no debug info
1>x265-static.lib(wavefront.obj) : warning LNK4099: PDB 'common.pdb' was not found with 'x265-static.lib(wavefront.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\common.pdb'; linking object as if no debug info
1>x265-static.lib(md5.obj) : warning LNK4099: PDB 'common.pdb' was not found with 'x265-static.lib(md5.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\common.pdb'; linking object as if no debug info
1>x265-static.lib(bitstream.obj) : warning LNK4099: PDB 'common.pdb' was not found with 'x265-static.lib(bitstream.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\common.pdb'; linking object as if no debug info
1>x265-static.lib(yuv.obj) : warning LNK4099: PDB 'common.pdb' was not found with 'x265-static.lib(yuv.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\common.pdb'; linking object as if no debug info
1>x265-static.lib(shortyuv.obj) : warning LNK4099: PDB 'common.pdb' was not found with 'x265-static.lib(shortyuv.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\common.pdb'; linking object as if no debug info
1>x265-static.lib(picyuv.obj) : warning LNK4099: PDB 'common.pdb' was not found with 'x265-static.lib(picyuv.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\common.pdb'; linking object as if no debug info
1>x265-static.lib(common.obj) : warning LNK4099: PDB 'common.pdb' was not found with 'x265-static.lib(common.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\common.pdb'; linking object as if no debug info
1>x265-static.lib(param.obj) : warning LNK4099: PDB 'common.pdb' was not found with 'x265-static.lib(param.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\common.pdb'; linking object as if no debug info
1>x265-static.lib(frame.obj) : warning LNK4099: PDB 'common.pdb' was not found with 'x265-static.lib(frame.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\common.pdb'; linking object as if no debug info
1>x265-static.lib(framedata.obj) : warning LNK4099: PDB 'common.pdb' was not found with 'x265-static.lib(framedata.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\common.pdb'; linking object as if no debug info
1>x265-static.lib(cudata.obj) : warning LNK4099: PDB 'common.pdb' was not found with 'x265-static.lib(cudata.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\common.pdb'; linking object as if no debug info
1>x265-static.lib(slice.obj) : warning LNK4099: PDB 'common.pdb' was not found with 'x265-static.lib(slice.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\common.pdb'; linking object as if no debug info
1>x265-static.lib(lowres.obj) : warning LNK4099: PDB 'common.pdb' was not found with 'x265-static.lib(lowres.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\common.pdb'; linking object as if no debug info
1>x265-static.lib(piclist.obj) : warning LNK4099: PDB 'common.pdb' was not found with 'x265-static.lib(piclist.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\common.pdb'; linking object as if no debug info
1>x265-static.lib(predict.obj) : warning LNK4099: PDB 'common.pdb' was not found with 'x265-static.lib(predict.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\common.pdb'; linking object as if no debug info
1>x265-static.lib(scalinglist.obj) : warning LNK4099: PDB 'common.pdb' was not found with 'x265-static.lib(scalinglist.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\common.pdb'; linking object as if no debug info
1>x265-static.lib(quant.obj) : warning LNK4099: PDB 'common.pdb' was not found with 'x265-static.lib(quant.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\common.pdb'; linking object as if no debug info
1>x265-static.lib(deblock.obj) : warning LNK4099: PDB 'common.pdb' was not found with 'x265-static.lib(deblock.obj)' or at 'D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\common.pdb'; linking object as if no debug info
1>echo.vcxproj -> D:\XTRANS\thunderbolt\ayame\zhb-bifrost\player-only\Halo\Debug\echo.exe
1>Done building project "echo.vcxproj".
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Build completed at 0:00 and took 01.114 seconds ==========
http://www.xdnf.cn/news/3679.html

相关文章:

  • JVM——JVM 是如何处理异常的?
  • 传奇各版本迭代时间及内容变化,屠龙/嗜魂法杖/逍遥扇第一次出现的时间和版本
  • Linux53 百度网盘运行(下载devtoolset11后仍提示stdc++3.0.29缺失 计划用docker容器隔离运行,计划后续再看)
  • 鼠标悬浮特效:常见6种背景类悬浮特效
  • Docker与WSL2如何清理
  • 一篇文章看懂web服务
  • NV203NV207SSD固态闪存NV208NV213
  • NoxLucky:个性化动态桌面,打造独一无二的手机体验
  • 用docker ffmpeg测试视频vmaf分数,很快不用编译
  • C#VisionMaster算子二次开发(非方案版)
  • NocoDB:开源的 Airtable 替代方案
  • operator 可以根据需要重载 == 运算符进行比较
  • 《告别试错式开发:TDD的精准质量锻造术》
  • 【quantity】7 角度单位模块(angle.rs)
  • 电脑RGB888P转换为JPEG方案 ,K230的RGB888P转换为JPEG方案
  • CGI(Common Gateway Interface)协议详解
  • 【AI面试准备】TensorFlow与PyTorch构建缺陷预测模型
  • AtCoder AT_abc404_g [ABC404G] Specified Range Sums
  • ​​信息泄露:网站敏感文件泄漏的隐形危机与防御之道​
  • 前端面试每日三题 - Day 23
  • 泰迪杯特等奖案例学习资料:基于时空图卷积网络的城市排水系统水位精准重建与异常检测
  • Power Query精通指南2:数据转换——透视/逆透视/分组、横向纵向合并数据、条件判断、处理日期时间
  • 如何设计抗Crosstalk能力强的PCB镀穿孔
  • Linux 进程间通信(IPC)详解
  • 【计算机视觉】目标检测:yoloV1~yoloV11项目论文及对比
  • 【信息系统项目管理师-论文真题】2011上半年论文详解(包括解题思路和写作要点)
  • LVGL -文本显示 英文、中文
  • MaC QT 槽函数和Lambda表达式
  • Leetcode刷题记录29——矩阵置零
  • 【JavaScript】性能优化:打造高效前端应用