Search code examples
cmingwwindows-7-x64undefined-referencelibsndfile

libsndfile : Undefined references


  • I've added the bin folder to system PATH as well "libsndfile-1.dll" to the main directory of the program.

  • I've linked the include directories and added the "libsndfile-1.lib" library from codeblocks's library linker.

  • I've made and linked additional .as from the dll and from the original definition file. Because it will complain otherwise.


After I've discovered that the header file does not define a function implied in the vast amount of examples.. I ran a program that only contains refers to the available functions. https://github.com/michaelwu/libsndfile/blob/master/examples/sfprocess.c Of course, something will not work again, because when I ran the program it threw the runtime error : The application was unable to start correctly (0xc000007b)


What am I missing now?


Solution

  • Validate the command-line, preferably compile manually.

    Make sure ALL the modules are from the x64 bit pre-compilation (they differ in size in the slightest), the static and dynamic libraries, including the .a you've made. The NTSTATUS error usually will occur when only a module is for use in x32 bit systems, but not the entire library. This truly matters in Audio Programming, because it very depends on it as you can conclude from the direct sound processing. So it's not really the library's fault.

    Don't install it with MSYS.

    ..and you don't have to append -lsndfile in the command line as long as you've linked all the libraries from within CB.