简体   繁体   English

在Windows下的代码块中链接64位sndfile库

[英]Linking 64bit sndfile lib in codeblocks under windows

I have an openframeworks project, which runs fine on OS X with sndfile, however under Windows, I have trouble with the linking. 我有一个openframeworks项目,该项目在OS X上使用sndfile可以很好地运行,但是在Windows下,链接有麻烦。 I've succesfully compiled a simple standalone project with the 32bit version, with these steps: 我已经成功地用以下32位版本编译了一个简单的独立项目:

  1. Added the lib file in the linker settings menu 在链接器设置菜单中添加了lib文件
  2. Added the bin and include folders in the search directories menu 在搜索目录菜单中添加了bin并包含文件夹
  3. Copied the dll to the debug folder 将dll复制到调试文件夹

I've linked the 64bit the same way, but it gives me undefined reference error, like undefined reference to 'sf_open ' I've tried changing my mingw compiler to a 64bit version, but there was no change. 我以相同的方式链接了64位,但是它给了我未定义的引用错误,例如对'sf_open未定义引用 。我试图将mingw编译器更改为64位版本,但是没有任何变化。

Is there something that I have to do differently when I link the lib in 64bit? 当我以64位链接lib时,我必须做些不同的事情吗? I can't use the 32bit version, because the openframeworks project won't run with it. 我不能使用32位版本,因为openframeworks项目将无法与其一起运行。

Figured it out: the problem was the compiler. 弄清楚了:问题出在编译器上。 I've only changed mingw in the global settings, I had to change it too in the project itself, to the 64bit version. 我只在全局设置中更改了mingw,也不得不在项目本身中将其更改为64位版本。 After that, it seems to work fine. 在那之后,它似乎工作正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM