c++ - Undefined Symbol: _sf_open (Simple audio stuff on OSX) -


I am trying to go into C ++ programming, and I am struggling against a little bit of detail. Right now, I am trying to get the snippet to work below, and apparently it will compile, but the link will not be there (error message is the bottom part of this post)

I have audio files I am using libsndfile to open, and Linker is not getting corrent library files for it. It's on OS X 10.5.

I downloaded libsndfile from mega-nerd.com and installed it as a user configure , create , sudo Process

Edit: Macpopes are installed on my system, if it is a matter of concern.

Here's my code:

  #include & lt; Iostream & gt; #include & lt; String & gt; # Include & lt; Sndfile.h & gt; #include "stereoSplit.h" using namespace std; Int Stereo Split (string filename) {cout & lt; & Lt; file name; SFNDOFF SFINFO; Sfinfo.format = 0; SNDFILE * soundfile; Soundfile = sf_open (filename.c_str (), sfmiad, & amp; sfinfo); Return 0; } Int main (four arguments, four kisses * RGV []) {return stereo split ("teststory."); }  

and there is a full error message here:

  Undefined symbols: "_sf_open", referenced from: stereoSplit (std :: basic_string & lt; char, Cc3hvkkk.o ld: mark (s) not found in std ::: Char_traits , std :: allocator & lt; char & gt; & gt;) Collection 2: ld back 1 Exit status < / Code> 

You have to link in the library. Your compiler command should look like this:

  G ++ mystuff.cpp -lndfile  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -