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 8750901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:56:50+00:00 2026-06-13T12:56:50+00:00

I am teaching myself how to read in wav files into C++ as a

  • 0

I am teaching myself how to read in wav files into C++ as a part of me learning C++. I have found many resources online that recommended the following library: libsnfile library
So I followed some tutorials below in testing the basic functionality of the library, but I can’t get the library to compile with Visual Studio 2010.

I have searched online for the following error, but did not find anything useful for my particular error. I downloaded the libsndfile C++ windows installer found here. I used the 32bit version since I am using the win32 C++ console version. However, my Visual Studio is 64 bit. I did the following after I downloaded the installer:

I went into Visual Studio. Under my project, I did the following:

In project properties:
1. VC++

Include >> added …\libsnfile\include
Library >> added …\libsnfile\lib
2. C\C++
Added the following directory as additional dependencies
…\libsnfile\lib\libsndfile-1.lib

I did this to add this third party library to my project. After this, to test, I ran the following code:

#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <sndfile.h>

int _tmain(int argc, _TCHAR* argv[])
{
    printf("This is a test\n");

   getchar();
   return 0; 
}

I coded that to make sure that I could access the sndfile.h in my program and everything compiled. The problem occured when I tried to implement the following code:

#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <sndfile.h>

int _tmain(int argc, _TCHAR* argv[])
{
    printf("This is a test\n");


    //This will be the length of the buffer used to hold samples while the program processes them. 


    //A SNDFILE is like FILE in a standard C library. Consequently, the sf_open_read and sf_open_write functions will return an 
    //SNDFILE* pointer when they successfully open the specified file. 
    SNDFILE* sf = NULL; 

    /*SF_INFO will obtain information of the file we wish to load into our program. */
    SF_INFO info; 


    /*This is where the program will open the WAV file */
    info.format = 0; 
    sf = sf_open("C:\Users\GeekyOmega\Desktop\gameon.wav", SFM_READ, &info);
    if(sf == NULL)
    {
        printf("Failed to open the file.\n");
        exit(-1);
    }

    getchar();
    return 0;
}

I then get a system error when I click run inside visual studio when I try to run my program. It says,

The program can't start because libsnfile-1.dll is missing from your computer. 
Try reinstalling the program to fix this problem.` 

I tried the 64 bit windows installer and tried that, but it didn’t work. Anyone understand what I am doing run? I am running Visual Studio’s 2010 on Windows 7 as my dev environment.

I apologize if I am making a silly mistake, but I would deeply appreciate if anyone could help me. I tried a few hacky fixes, as I talked about above, but nothing has worked.

EDIT: I am also aware of this thread here, but this doesn’t make any sense to my current issue as I am not doing any of this path stuff that they are talking about.

Warm Regards,
GeekyOmega

  • 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-13T12:56:51+00:00Added an answer on June 13, 2026 at 12:56 pm

    I fixed the issue. For future readers, this is a very common problem, I think. I placed the .dll in the debug folder of my Visual Studio project. Visual Studio couldn’t see the .dll file otherwise. After this, the program fired up as expected and ran. If this does not fix the issue for you, then I suggest something else could be going on.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm teaching myself (read hacking) through some old Excel Macros that are quite long.
I'm pretty good at Haskell and have been teaching myself J . I've read
I've been teaching myself C++ and someone told me that C++ does not have
Teaching myself some c# and my problem is that I have a class which
I just started teaching myself C++ on the Mac, and I have run into
I have recently started teaching myself C# and Asp.net. I am trying to build
I'm teaching myself programming and today's challenge is to write a program that can
I am teaching myself to use JavaCC in a hobby project, and have a
Im still teaching myself Java so I wanted to try to read a text
I've been teaching myself F# for a while now. I've read Programming F# by

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.