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

  • Home
  • SEARCH
  • 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 8775965
In Process

The Archive Base Latest Questions

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

I have a C++ program not reading an absolute path in Visual Studio. The

  • 0

I have a C++ program not reading an absolute path in Visual Studio.

The following code works on my desktop environment (Windows 7, Visual Studio 2010, 64 bit).
However, on my macbook, I am running bootcamp and/or VMware for a Windows 7 64 bit virtual machine that has the exact same Visual Studio 2010.

My attempts at fixing this problem:

  1. I made sure that the absolute path is the same on my macbook as it is on the desktop. I further made double sure that I installed the third party library to read my wave file in
    the same fashion as I did for the desktop twice.

  2. I rewrote the program that run on the desktop, reinstalled the library on my macbook. Simpler program works on desktop, but alas, still failed to read absolute path on macbook.

  3. I moved the wav file so not to be a path, but in the actual project solution itself. No change.

  4. Google.

I include the code at the bottom, for your benefit. I used libsndfile library to read a wav file. I may just try to use my very old crappy Windows laptop, but would can’t understand what could be going wrong on my macbook VM machine.

// WaveReader.cpp : main project file.

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

using namespace System;

int main(array<System::String ^> ^args)
{
    Console::WriteLine(L"Hello World");
    SNDFILE *sf; 
    SF_INFO info; 

    /*Open the wav file. */
    info.format = 0;
    sf = sf_open("C:\\Users\\geekyomega\\gameover.wav",SFM_READ,&info);
    if (sf == NULL)
    {
        printf("Failed to open the file.\n");
        getchar();
        exit(-1);
    }

}

My output, when I run this program is

Failed to open the file

As always, thank you for reading through this question. I deeply would appreciate any help, assistance, or wisdom any of you would have. Especially if you encountered a similar problem.

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-13T18:56:11+00:00Added an answer on June 13, 2026 at 6:56 pm

    It turned out to be related to permissions. Also, Hans Passant is right in that absolute paths are not good coding practice. This was meant as a proof of concept, so please let me off on that technicality.

    Regards,
    GeekyOmega

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

Sidebar

Related Questions

I have a program which works with strings (Pascal). After reading a string if
We have a program with a main() that parses certain CLPs but does not
Let's say I have a program to write text into a file (not really
I have a C program with a couple of static functions that are not
Edit (updated question) I have a simple C program: // it is not important
I have a C++ program that crashed due to a bug. It would not
I have a question considering a program that stimulates a stack (not using any
I have a System.Drawing.Image in my program. The file is not on the file
I have getRuntime().exec() calls in my program; however, two of them will not work:
How can I implement generics in this program so I do not have 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.