# VC++ Errors =^(

This topic is 4155 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Ok, I'm trying to make a generic Menu class for helping with console output in my project I'm working on, and I've run into an error I can't get my head around. Here's the code:
//Menu.h

{
private:
std::string m_Title;
int m_OptionsAmount;
char m_Input;

char GetInput();
public:
//Create the menu with a given title or default string
//Remove an option from the menu
void RemoveOption(int key);

//Set/Get the title of the menu
void SetTitle(std::string title);
std::string GetTitle();

//Get the amount of options in the menu
int GetAmount();

};


	vector<MenuOption> m_Options;

which is giving me the following errors:
------ Build started: Project: colormenu, Configuration: Debug Win32 ------
Compiling...
c:\c++\tut\tut7\colormenu\Menu.h(11) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int


This is my first time working with vectors so I'm probably doing something wrong. Anyone got any ideas?

##### Share on other sites
Did you #include <vector>? Also, since this is a header file, it would be best if you used std::vector instead of importing std(::vector) into the global namespace.

jfl.

##### Share on other sites
In order for the compiler to deduce the correct template settings it needs the full definition of MenuOption. You only provided it the forward declaration. That's simply not enough for a template.

You can either

or

##### Share on other sites
Thank you for the help both of yas. +Rep!

Hopefully I can finish up this segment tonight now.