ctodd
ctodd

Reputation: 1

Building Portaudio in C on Sublime Text 3

I'm attempting to build an example code from portaudio using the library from this page. https://github.com/adfernandes/precompiled-portaudio-windows

My sublime-build file is the following:

{
    "cmd" : ["gcc", "$file_name", "-L/Desktop/portaudio-r1891-build/lib/x64/ReleaseMinDependency", "-llibportaudio_x64", "-o", "${file_base_name}.exe", "&&", "${file_base_name}.exe"],
    "selector" : "source.c",
    "shell" : true,
    "working_dir" : "$file_path"
}

I receive the error "c:/mingw/bin/../lib/gcc/mingw32/4.9.3/../../../../mingw32/bin/ld.exe: cannot find -llibportaudio_x64

I'm new to make files so am unsure what's incorrect. Without the portaudio additions, the make file properly builds a Hello World test code. The portaudio stuff is not in a standard path. I have "#include "portaudio.h" in the portaudio example code and the .h file in the same folder as the example code. I have the folder of the libraries on my desktop and am attempting to link it's path to that folder with the -L command. I've seen some people discussing about having a .a file but I don't seem to have one from the library downloaded.

Upvotes: 0

Views: 140

Answers (1)

a3f
a3f

Reputation: 8657

You are linking your 32-bit program against the 64 bit version of the DLL.

Either change the Link path (-L) to the 32-bit DLL's location or use a 64-bit compiler.

At first I suspected it's the missing lib prefix, but the MinGW documentation says that the lib can be omitted on Windows.

Upvotes: 0

Related Questions