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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:55:16+00:00 2026-06-17T20:55:16+00:00

I am working on a c++ program and I have made a TextUserInterface class

  • 0

I am working on a c++ program and I have made a TextUserInterface class and am trying to call an instance of it inside of the main method. Here is the TextUserInterface.h, TextUserInterface.cpp, and GasStationFinder.cpp(houses main method).

#include <iostream>
using namespace std;


using namespace view; // compiler is comlaining here saying '<type error>' is not
                       // a namespace and expected namespace name before ;
#include "TextUserInterface.h"

int main() {
    view::TextUserInterface tui;
     tui.run();
    return 0;
}

TextUserInterface.h

/*
 * TextUserInterface.h
 *
 *  Created on: Jan 27, 2013
 *      Author: Chris
 */

#ifndef TEXTUSERINTERFACE_H_
#define TEXTUSERINTERFACE_H_

namespace view {

class TextUserInterface {
public:
    TextUserInterface();
    void run();
virtual ~TextUserInterface();
};

} /* namespace view */
#endif /* TEXTUSERINTERFACE_H_ */

TextUserInterface.cpp

 /*
  * TextUserInterface.cpp
 *
 *  Created on: Jan 27, 2013
 *      Author: Chris
 */

#include <iostream>
using namespace std;


#include "TextUserInterface.h"

namespace view {

TextUserInterface::TextUserInterface() {
    // TODO Auto-generated constructor stub

}

void TextUserInterface::run(){

cout << "Welcome to the Gas Station Finder" << endl;
    cout << "" << endl;
cout << "What would you like to query: (m)inimum price, ma(x)imum price, 
(p)repay pumps, (t)hreshold price, (l)ist stations, (q)uit?" << endl;

}

 TextUserInterface::~TextUserInterface() {
    // TODO Auto-generated destructor stub
}

} /* namespace view */
  • 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-17T20:55:17+00:00Added an answer on June 17, 2026 at 8:55 pm

    You are using the namespace before including the header. Switch them around otherwise the compiler cannot recognize this identifier.

    #include "TextUserInterface.h"
    using namespace view;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made a simple program with : working with files(read write) end class
I have this program that I am working on for class, I think the
I have made a program with a scroll pane, but it is not working.
I am working on Erlang robotic project. I have made a wallfollower robot program
I have made a multi-threading program. In it, the main thread starts 10 threads
I have program that opens subwindows inside of it (mdi.parent). I have made component
I have a working program in C++ that generates data for a Mandelbrot Set.
I have a working C program where the length of an array of strings
I have a program that I'm working on that register global hotkeys I would
I'm working on a vbscript program and I have got and Expected Statement Error.

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.