Search code examples
c++codeblocksopenframeworkslibsndfile

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. I've succesfully compiled a simple standalone project with the 32bit version, with these steps:

  1. Added the lib file in the linker settings menu
  2. Added the bin and include folders in the search directories menu
  3. Copied the dll to the debug folder

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.

Is there something that I have to do differently when I link the lib in 64bit? I can't use the 32bit version, because the openframeworks project won't run with it.


Solution

  • 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. After that, it seems to work fine.