Help linking external libraries (OSX) [SOLVED]

I’m trying to link an external library (librtlsdr, as downloaded from homebrew) and am having some problems. The error I’m getting is:

Undefined symbols for architecture x86_64:
  "_rtlsdr_get_device_count", referenced from:
      ofApp::setup() in ofApp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Though this error happens for every function in librtlsdr. I am able to use the library in standalone c++ files, by doing e.g. g++ -Wall my_program_name.cpp -lrtlsdr, so I’m assuming there is a super straight-forward solution, but so far nothing has worked for me unfortunately.

Is there a simple way to link c++ libraries in openFrameworks? I’m on OSX and generally use make to compile, so would prefer a solution based around that, but am happy to use Xcode if that is what this requires. I’m on OSX 10.12.6 Sierra running openFrameworks 0.10.0.

Thank you so much in advance!

Ayyy so I’m a moron, this is super easy. This forum answer helped, all I had to do was add the line:


to the config.make file and now everything works. I wasn’t searching for makefile which is what brought up that forum question/answer. Gonna leave this here in case it helps anyone else.

did you have good results with librtlsdr? I’m looking into using it with OF and was wondering if there are any pitfalls I should look out for?

librtlsdr worked great for me. Here’s the code i wrote using it in case you’re interested.