If you have any source file that includes GameObjects.h
before ProjectilObject.h
or does not include ProjectilObject.h
directly, then the compiler will first find the declaration of ProjectilObject
through the include in GameObjects.h
before knowing what WorldObject
is. That is because GameObjects.h
first includes ProjectilObject.h
and then declares WorldObject
. In that case the include of GameObjects.h
present in ProjectilObject.h
won’t work because _GAMEONJECTCODE_H_
will be already defined.
To avoid this, either be sure to include ProjectilObject.h
instead of GameObjects.h
in your source file, or use forward declarations.
Related Posts:
- Linker Error C++ “undefined reference ” [duplicate]
- Expression must have class type
- c++ “Incomplete type not allowed” error accessing class reference information (Circular dependency with forward declaration)
- Why is enum class preferred over plain enum?
- Undefined Symbols for architecture x86_64: Compiling problems
- Why am I getting this redefinition of class error?
- Single class has a Class Redefinition Error
- C++ Linked List Node with class
- (->) arrow operator and (.) dot operator , class pointer
- Separating class code into a header and cpp file
- how to define -std=c++11 as default in g++
- Pointer to incomplete class type is not allowed
- Why am I getting this redefinition of class error?
- no default constructor exists for class
- Getting error “a nonstatic member reference must be relative to a specific object” while both member are in the same class
- Error “C++ requires a type specifier for all declarations whilst defining methods”
- What are the differences between struct and class in C++?
- error C2011: ” : ‘class’ type redefinition
- The compiler is complaining about my default parameters?
- C++ Linked List Node with class
- Getting error: ISO C++ forbids declaration of with no type
- “used without template parameters”
- expected constructor, destructor, or type conversion before ‘(’ token
- C++ Class ‘undeclared identifier”
- c++ “Incomplete type not allowed” error accessing class reference information (Circular dependency with forward declaration)
- Warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11?
- What is the meaning of a C++ Wrapper Class?
- Does C++11 have C#-style properties?
- G++ undefined reference to class::function
- Creating an instance of class
- expected primary-expression before ‘]’ token
- error C2039: ‘string’ : is not a member of ‘std’, header file problem
- istream and ostream problem – C++
- Struct with template variables in C++
- error: no member function declared in class
- Here is some error with my .h file which show [Error] unterminated #ifndef when I include my class template in it
- Error: invalid use of member in static member function
- 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`?
- Difference between != and =! with an example(in C++)
- Unresolved external symbol in object files
- How do sizeof(arr) / sizeof(arr[0]) work?
- 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
- Inheriting constructors
- 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++
- “items list” or “item list”
- When and why do I need to use cin.ignore() in C++?
- undefined reference to ‘std::cout’
- warning: control may reach end of non-void function
- Error at constructor : Expected an identifier?
- identifier “string” undefined?
- What does LPCWSTR stand for and how should it be handled with?
- VC++ fatal error LNK1168: cannot open filename.exe for writing
- 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: request for member ‘..’ in ‘..’ which is of non-class type
- Socket API or library for C++?
- Initialize empty vector in structure – c++
- C++ catching all exceptions
- C++ Expression must have pointer-to-object type
- C++ “Access violation reading location” Error
- IntelliSense: the object has type qualifiers that are not compatible with the member function
- codingbat-like site for C++
- extra qualification error in C++
- RPN Calculator for C++
- 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?
- How to print a string in C++
- C++ operator+ and operator+= overloading
- In c++ what does a tilde “~” before a function name signify?
- C++ Void Function with File Stream Error
- sorting in std::map where key is a std::string
- 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
- DEV C ++ Error: expected declaration before ‘}’ token
- Link error “undefined reference to `__gxx_personality_v0′” and g++ [duplicate]
- How to use bitmask?
- -Error reading characters of string