我在vs code中调用windows.h的API播放音乐的时候出现了问题。(但是同样的C++程序在VC6.0的环境下时正常的)。
错误如下:

VS code :undefined reference to `__imp_PlaySoundW‘ 等类似问题
解决办法:
在task.json中加入“-lwinmm”即可解决
VS code :undefined reference to `__imp_PlaySoundW‘ 等类似问题
另外,我在发送邮件的时候也出现了类似的错误:
VS code :undefined reference to `__imp_PlaySoundW‘ 等类似问题
解决办法和上边类似:
VS code :undefined reference to `__imp_PlaySoundW‘ 等类似问题总结:
由以上不难看出VS code中这种类似的错误“undefined reference to ‘_imp_XXX’ ”的解决办法应该是在task.json中加上点东西就可以了。具体加什么,根据实际情况来看。
参考文章:
https://www.jianshu.com/p/3927cad8d2cd
https://ask.csdn.net/questions/1087885

相关文章:

  • 2021-05-21
  • 2022-12-23
  • 2022-12-23
  • 2021-09-02
  • 2022-01-09
  • 2021-06-21
猜你喜欢
  • 2022-02-28
  • 2021-12-03
  • 2021-05-18
  • 2021-08-02
  • 2022-02-24
  • 2021-09-22
  • 2022-01-08
相关资源
相似解决方案