gpt4 book ai didi

c++ - 将 libsndfile 库链接到 Code::Blocks on Windows

转载 作者:太空宇宙 更新时间:2023-11-04 13:16:25 30 4
gpt4 key购买 nike

我已经从 Mega-Nerd 网站安装了 sndfile。安装后,我尝试使用这种方法将它添加到代码块中:

How do I link to a library with Code::Blocks?

程序仍然没有看到库中定义的方法给我错误:

C:\Users\Blanka\Desktop\asdasdasd\main.c|13|undefined reference to `sf_open'| ||error: ld returned 1 exit status|

我正在提供库的路径,提供编译标志并手动将头文件粘贴到项目文件夹中,但没有任何帮助。问题在于它从 sndfile.h header 中看到其他函数/变量,例如 SF_INFOSF_FORMAT_WAVE

我已经在 Ubuntu 上成功安装了这个库,但是我现在需要在 Windows 上安装它。

最佳答案

尝试使用visual studio。 snffile Windows 安装程序只是将“libsndfile-1.lib”放入目标,但 coodblocks 需要 .a 来链接 mingw。

关于c++ - 将 libsndfile 库链接到 Code::Blocks on Windows,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37079686/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com