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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:58:22+00:00 2026-05-31T13:58:22+00:00

I have an interface declared in its own header MyInterface.h: class MyInterface{ public: virtual

  • 0

I have an interface declared in its own header MyInterface.h:

class MyInterface{
public:
    virtual ~MyInterface(){}
    virtual void initialize() = 0;
    virtual void newValueSound(int stream, double value) = 0;
    virtual void newValueAlg1(int stream, double value) = 0;
    virtual void newValueAlg2(int stream, double value) = 0;
};

Whenever I include this header and try to use the interface, for example:

#include "MyInterface.h"

void someMethod(){
    MyInterface *interface;
}

I get strange compile errors on the line:

error C2332: ‘struct’ : missing tag name
error C2011: ‘<unnamed-tag>’ : ‘enum’ type redefinition
error C2226: syntax error : unexpected type ‘<unnamed-tag>’

What is wrong with my code?

EDIT:
Header has include guards.
I use Eclipse CDT with Microsoft compiler.

The whole header:

#ifndef MYINTERFACE_H_
#define MYINTERFACE_H_

class MyInterface{
public:
    virtual ~MyInterface(){}
    virtual void initialize() = 0;
    virtual void newValueSound(int stream, double value) = 0;
    virtual void newValueAlg1(int stream, double value) = 0;
    virtual void newValueAlg2(int stream, double value) = 0;
};

#endif

and the class it is used in:

#ifndef MAIN_H_
#define MAIN_H_

#include <asio.h>
#include "Stream.h"
#include "MyInterface.h"

class MicApp {
private:
    long inputChannelCount;
    Stream **streams;
    MyInterface *interface;
public:
    MicApp(MyInterface *interface);
    void initializeASIODrivers();
    char **getDriverNames(int *numberOfDrivers);
    bool loadDriver(char *driverName);
    ASIOError initDriver(ASIODriverInfo *asioDriverInfo);
    long getChannelCount();
    double getSampleRate();
    void activateStream(bool activate, int stream);
    ASIOError startASIO();
    ASIOError stopASIO();
    ASIOError exitDriver();
};

#endif

Note that “Stream” is another class and it is used without any problems.

  • 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-31T13:58:24+00:00Added an answer on May 31, 2026 at 1:58 pm

    The thing was that the string “interface” is typedef’ed in ObjBase.h. So I cannot use “interface” as identifier. If I use another string as identifier, it works ok

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

Sidebar

Related Questions

Have a interface class abc { public: virtual int foo() = 0; ... }
I have two properties declared for my class in its interface file Account.h @interface
Let's say I have a class declared as: @class SomeClass @interface SomeClass: NSObject {
Suppose we have: interface Foo { bool Func(int x); } class Bar: Foo {
I have this property synthesized and declared in my class 'ClassA' @interface ClassA @property
I have a class 'DOInstance' which I inherit later on. Here's its declaration: @interface
I have the following interface declared in C#: public interface ArtistInterface { bool Flag
I have an interface declared as IRetrievable<T, idT> where T is the retrieved type
I have a C# interface with certain method parameters declared as object types. However,
Let's say we have a class with an NSTimeInterval property: @interface MyClass : NSObject

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.