You’ve not included <string>
header file in stock.h
header file, even though you’re using std::string
in it. Maybe that is causing this error message (if that is the case, then I would say its really a bad message).
Another problem is that in Stock
class definition, you’ve written this:
bool Stock::operator > (Stock & aStock);
which is wrong. Remove Stock::
from it, and make it like this:
bool operator > (const Stock & aStock); //^^^^ add this also (better)
Stock::
is required when defining the function outside the class.
Related Posts:
- Why do C++ objects have a default destructor?
- What does the explicit keyword mean?
- Struct Constructor in C++?
- C++ struct constructor
- What does the explicit keyword mean?
- Inheriting constructors
- Inheriting constructors
- how to define -std=c++11 as default in g++
- C++ error: no matching constructor for initialization of
- c++: No instance of overloaded function
- no default constructor exists for class
- Java class “cannot be resolved to a type”
- error: overloaded ‘operator<<' must be a binary operator (has 3 parameters)
- Getting error: ISO C++ forbids declaration of with no type
- QltAW.png
- Error: No instance of constructor matches the argument list
- expected constructor, destructor, or type conversion before ‘(’ token
- C++ template constructor
- How does rhs work?
- expected identifier before string constant
- Creating an instance of class
- In C++ can constructor and destructor be inline functions?
- Constructor overload in TypeScript
- When is it safe to call this-> in constructor and destructor
- C++ Cannot call constructor directly in small example
- What is the best way to give a C# auto-property an initial value?
- Here is some error with my .h file which show [Error] unterminated #ifndef when I include my class template in it
- outputting ascii table in C++
- What is the effect of extern “C” in C++?
- What exactly is the difference between “pass by reference” in C and in C++?
- What is `CString`?
- Binary Search Tree Implementation in C++ STL?
- Difference between != and =! with an example(in C++)
- Unresolved external symbol in object files
- How do sizeof(arr) / sizeof(arr[0]) work?
- Logical XOR operator in C++?
- C++ – Decimal to binary converting
- Alternative to itoa() for converting integer to string C++?
- 1e-9 or -1e9, which one is correct?
- Returning an empty string : efficient way in c++
- invalid conversion from ‘const char*’ to ‘char*’
- Evaluate a string with a switch in C++ [duplicate]
- Expected initializer before function name
- Pass a vector by reference C++
- lvalue required as left operand of assignment – Array
- What is uintptr_t data type
- Why do we use volatile keyword? [duplicate]
- C++ round a double up to 2 decimal places
- Windows 7 exception code: 0xc0000409
- Convert float to std::string in C++
- terminate called after throwing an instance of ‘std::out_of_range’
- What does “missing template argument” mean?
- undefined reference to ‘std::cout’
- warning: control may reach end of non-void function
- Why do this() and super() have to be the first statement in a constructor?
- Error at constructor : Expected an identifier?
- identifier “string” undefined?
- Difference in make_shared and normal shared_ptr in C++
- VC++ fatal error LNK1168: cannot open filename.exe for writing
- Visual C++ find line causing “Debug Assertion failed”
- Reading integers from file and store them in array C++ [closed]
- Uninitialised value was created by a stack allocation
- C++ Image Processing Libraries
- Printing the correct number of decimal points with cout
- error C2011: ” : ‘class’ type redefinition
- error: request for member ‘..’ in ‘..’ which is of non-class type
- Multiple OR or AND conditions in IF statement
- What does it mean double free detected in tcache 2 while using mpz?
- fatal error LNK1169: one or more multiply defined symbols found in game programming
- How to initialize a vector of pointers
- C++: Using ifstream with getline();
- How to add element to C++ array?
- How to do constructor chaining in C#
- Random not declared in scope
- What does the “Expected ‘(‘ for function-style cast or type construction” error mean?
- LINK : fatal error LNK1561: entry point must be defined ERROR IN VC++
- Comparing the values of char arrays in C++
- Win32 Console Application
- What does the fpermissive flag do?
- Convert char array to single int?
- https://stackoverflow.com/questions/3865946/error-generic-array-creation
- C++ variable has initializer but incomplete type?
- Does C++11 have C#-style properties?
- How to print a string in C++
- Destructor for a doubly-linked list that points to its value
- cin.ignore(numeric_limits
::max(), ‘\n’) - LLVM Compiler 2.0: Warning with “using namespace std;”
- C++ operator+ and operator+= overloading
- In c++ what does a tilde “~” before a function name signify?
- C++ Void Function with File Stream Error
- glibc detected : double free or corruption
- What is the best way to develop a C++ web application?
- How to install Visual Studio Build Tools 2010 on Visual Studio 2015 Community?
- Throwing out of range exception in C++
- Is null reference possible?
- Negative RGB Values
- Link error “undefined reference to `__gxx_personality_v0′” and g++ [duplicate]
- How to use bitmask?
- How do I check if a Key is pressed on C++
- -Error reading characters of string