Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9003047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:39:49+00:00 2026-06-16T00:39:49+00:00

I am trying to use libsndfile. I am also not very good with g++.

  • 0

I am trying to use libsndfile. I am also not very good with g++. The way to install libsndfile seems to be use “make install.” I can really do that so I compiled it in a directory.

I was trying to compile the tutorial here:
http://parumi.wordpress.com/2007/12/16/how-to-write-wav-files-in-c-using-libsndfile/

when I try the following:

g++  -Isrc/ test.c

I get:

/tmp/ccq5fhbT.o: In function SndfileHandle::SndfileHandle(char const*, int, int, int, int)':
test.c:(.text._ZN13SndfileHandleC1EPKciiii[SndfileHandle::SndfileHandle(char const*, int, int, int, int)]+0xf4): undefined reference to sf_open'
/tmp/ccq5fhbT.o: In function SndfileHandle::write(float const*, long)':
test.c:(.text._ZN13SndfileHandle5writeEPKfl[SndfileHandle::write(float const*, long)]+0x27): undefined reference to sf_write_float'
/tmp/ccq5fhbT.o: In function SndfileHandle::SNDFILE_ref::~SNDFILE_ref()':
test.c:(.text._ZN13SndfileHandle11SNDFILE_refD1Ev[SndfileHandle::SNDFILE_ref::~SNDFILE_ref()]+0x20): undefined reference to sf_close'
collect2: ld returned 1 exit status

When I try to do the following:

g++ -lsndfile -Isrc/ test.c

I get

/usr/bin/ld: cannot find -lsndfile
collect2: ld returned 1 exit status

I am not sure what switches I need to give g++.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T00:39:50+00:00Added an answer on June 16, 2026 at 12:39 am

    If you configure and install libsndfile with:

    ./configure --prefix=$HOME/local
    make
    make install
    

    you should then set/modify your LD_LIBRARY_PATH variable:

    export $LD_LIBRARY_PATH=$HOME/local/lib
    

    and then compile with

    g++ -I $HOME/local/include -L $HOME/local/lib -lsndfile testsnd.c -o  testsnd
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to use the RHEL5.3 GCC 4.3.2 compiler to build my software on that
I'm trying use make a div's background transparent using a mixture of CSS3 rgba()
I'm trying use eco for client-side templating. I have multiple .eco templates that I'd
I am trying use a from a multi-dimensional array that I create in another
I am trying use cursor for pagination. Forwarding pagination work fine, but I can
I have a regex that I'm trying use to validate against strings. Trying to
I have a 3rd party DLL that I am trying to use in a
I'm trying use an object which wasn't available until SDK level 5. It seems
I am trying use Accrev plugin for visual studio 2010. I am not sure
I'm trying use the modulo operator (%) on long longs, and it seems to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.