【问题标题】:sndfile.h C CodeBlocks Windows 7sndfile.h C 代码块 Windows 7
【发布时间】:2013-06-01 06:23:23
【问题描述】:

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

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

"对 sf_open_fd 的未定义引用"

代码如下:

#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);
    .
    .
    .
}

有什么想法吗?谢谢!

【问题讨论】:

  • 关注this可以解决这个问题。

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


【解决方案1】:
  1. 检查库和应用程序是否适用于相同的架构(例如 x64)。
  2. 检查库是否链接到应用程序。
  3. 检查应用程序和库是否使用 c 编译器编译。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多