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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:08:27+00:00 2026-05-14T03:08:27+00:00

I have this source code from 2001 that I would like to compile. It

  • 0

I have this source code from 2001 that I would like to compile.

It gives this:

$ make
g++ -O99 -Wall -DLINUX -pedantic   -c -o audio.o audio.cpp
In file included from audio.cpp:7:
audio.h:14: error: use of enum ‘mad_flow’ without previous declaration
audio.h:15: error: use of enum ‘mad_flow’ without previous declaration
audio.h:17: error: use of enum ‘mad_flow’ without previous declaration
audio.cpp: In function ‘mad_flow audio::input(void*, mad_stream*)’:
audio.cpp:19: error: new declaration ‘mad_flow audio::input(void*, mad_stream*)’
audio.h:14: error: ambiguates old declaration ‘int audio::input(void*, mad_stream*)’
audio.h:11: error: ‘size_t audio::stream::BufferPos’ is private
audio.cpp:23: error: within this context
audio.h:11: error: ‘size_t audio::stream::BufferSize’ is private
audio.cpp:23: error: within this context
audio.h:10: error: ‘char* audio::stream::Buffer’ is private
audio.cpp:26: error: within this context
audio.h:11: error: ‘size_t audio::stream::BufferSize’ is private
audio.cpp:26: error: within this context
audio.h:11: error: ‘size_t audio::stream::BufferPos’ is private
audio.cpp:27: error: within this context
audio.h:11: error: ‘size_t audio::stream::BufferSize’ is private
audio.cpp:27: error: within this context
audio.cpp: In function ‘mad_flow audio::output(void*, const mad_header*, mad_pcm*)’:
audio.cpp:49: error: new declaration ‘mad_flow audio::output(void*, const mad_header*, mad_pcm*)’
audio.h:15: error: ambiguates old declaration ‘int audio::output(void*, const mad_header*, mad_pcm*)’
audio.cpp: In function ‘mad_flow audio::error(void*, mad_stream*, mad_frame*)’:
audio.cpp:83: error: new declaration ‘mad_flow audio::error(void*, mad_stream*, mad_frame*)’
audio.h:17: error: ambiguates old declaration ‘int audio::error(void*, mad_stream*, mad_frame*)’
audio.cpp: In constructor ‘audio::stream::stream(const char*)’:
audio.cpp:119: error: ‘input’ was not declared in this scope
audio.cpp:122: error: ‘output’ was not declared in this scope
audio.cpp:123: error: ‘error’ was not declared in this scope
make: *** [audio.o] Error 1

audio.h contains

#ifndef _AUDIO_H_
#define _AUDIO_H_

#include <stdlib.h>
#include "mad.h"

namespace audio {
  class stream {
  private:
    char* Buffer;
    size_t BufferSize, BufferPos;
    struct mad_decoder Decoder;

    friend enum mad_flow input(void* Data, struct mad_stream* MadStream);
    friend enum mad_flow output(void* Data, const struct mad_header* Header,
                struct mad_pcm* PCM);
    friend enum mad_flow error(void* Data, struct mad_stream* MadStream,
                   struct mad_frame* Frame);

  public:
    stream(const char* FileName);
    ~stream();

    void play();
  };
}

#endif

Update:

The problem seams to be that mad_flow can’t been seen. If I look in mad.h, then mad_flow is declared there.

If I just copy/paste

  enum mad_flow {
    MAD_FLOW_CONTINUE = 0x0000,
    MAD_FLOW_STOP     = 0x0010,
    MAD_FLOW_BREAK    = 0x0011,
    MAD_FLOW_IGNORE   = 0x0020
  };

from mad.h the error goes away (and new errors occur).

So how do I make mad_flow available?

  • 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-05-14T03:08:27+00:00Added an answer on May 14, 2026 at 3:08 am

    Regarding:

    I have tried to just insert

    enum mad_flow {};
    

    … a correct forward declaration of the type mad_flow would be:

    enum mad_flow ;
    

    But you should really be asking yourself why the declaration or definition is not already visible since the forward declaration is probably a bit of a kludge. Are all the necessary headers included?

    [—edit—]

    In response to Johannes Schaub’s comment, here’s a compilable example of a forward declared enum:

    enum mad_flow ;             // forward declaration
    
    void f( mad_flow& arg ) ;   // forward declaration of function 
                                // using incomplete type
    
    int main()
    {
        mad_flow x ;            // Declaration using incomplete type
    
        f( x ) ;                // Function call using incomplete enum object
    }
    
    enum mad_flow               // Completion of the definition
    {
        VALUE1,
        VALUE2
    } ;
    
    void f( mad_flow& arg )
    {
        arg = VALUE1 ;          // Use of value from complete definition
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this long and complex source code that uses a RNG with a
I have this small code library that I'm considering releasing into Open Source. I
I have some C++ source code with templates maybe like this - doxygen runs
I have this source code where I got it from net tutsplus. I have
I have been trying to follow this example (download the source code from a
I have only this in my mxml source code: <?xml version=1.0 encoding=utf-8?> <mx:Canvas xmlns:mx=http://www.adobe.com/2006/mxml
I have several sources of tables with personal data, like this: SOURCE 1 ID,
I have this code in jQuery, that I want to reimplement with the prototype
I am using make on linux. I downloaded the GCC source code from svn
I have one question, I have such code this._engine = Python.CreateEngine(); ScriptSource source =

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.