c - sndfile.h C CodeBlocks Windows 7

标签 c compiler-errors codeblocks windows-7-x64 libsndfile

我正在 Windows 7(64 位)上开发 CodeBlocks 12.11。我正在用 C 编程,我正在使用库:libsndfile (http://www.mega-nerd.com/libsndfile/api.html) 轻松读取 .wav 并将其转换为 double 组。

我运行了 libsndfile 的向导(适用于 windows 64 位),还在 Codeblocks 的编译器设置中,我添加了编译器和链接器的搜索目录。但是,当我编译程序时,唯一的错误是:

对 sf_open_fd 的 undefined reference

代码如下:

#include <stdio.h>
#include <stdlib.h>  
#include <sndfile.h>

int main (int argc, char *argv[]) {

    FILE* wavf;
    SF_INFO info;
    char* name = "example.wav";
    wavf = fopen(name, "r");
    SNDFILE* source = sf_open_fd(fileno(wavf), SFM_READ, &info, 1);
    .
    .
    .
}

有什么想法吗?谢谢!

最佳答案

  1. 检查库和应用程序是否适用于相同的体系结构(比如 x64)。
  2. 检查图书馆是否链接到应用程序。
  3. 检查应用程序和库是否使用c编译器编译。

关于c - sndfile.h C CodeBlocks Windows 7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16869778/

相关文章:

c - linux下如何获取随机文件?包括子目录

C 动态数组

c - 矩阵内结构内的数组

c++ - 在 Code::Blocks with Dependencies 中编译

c - 我使用 C 编程在我的帕斯卡三角形中有一些间距错误

c++ - 重载时出现 undefined reference 错误

swift - 显示 = brain.evaluateWithErrorReport(添加了使用 : dictionaryForVaribles) gives an error unless an as!。为什么?

c# - CS0234 引用本地项目

代码块自动完成/调用提示不适用于 C 标准库函数

c++ - 编译 Box2D 时创建 libBox2D.a?