Error 2061
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow error c2146 syntax error missing ' ' before identifier the company Business Learn more about hiring developers or posting ads with us Stack
Error C2061
Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of error 2061 c++ 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error C2061 In visual studio up vote 0 down vote favorite 1 I try to reference a struct error 2065 from another class in my code and it gives me an error, saying I have a syntax problem. #pragma once #include "Definitions.h" #include "GV.h" #include "UI.h" #include "Tile.h" #include "Item.h" class Figure { public: //Figure index struct FIGURE_TYPE { //Where to crop the image from SDL_Rect crop; int x; int y; }; //The game figure FIGURE_TYPE figure_index[FIGURE_COUNT]; //The figure array int figure_array[MAP_HEIGHT / 64][MAP_WIDTH / 64]; //Functions Figure ( void ); bool
Error 2059
draw_figures ( SDL_Surface* screen, SDL_Surface* figures, SDL_Rect camera, Figure::FIGURE_TYPE figure_spec[FIGURE_COUNT] ); }; That's the struct in Figure.h, #pragma once #include "Definitions.h" #include "GV.h" #include "Tile.h" #include "Item.h" #include "Figure.h" class UI { public: UI ( void ); void set_camera ( SDL_Rect& camera, Figure::FIGURE_TYPE figure_spec[FIGURE_COUNT] ); bool draw_map ( SDL_Surface* screen, SDL_Rect& camera, SDL_Surface* tiles, SDL_Surface* figures, Figure::FIGURE_TYPE figure_spec[FIGURE_COUNT] ); bool draw_status ( void ); }; And that is where I reference it, from another header file called UI.h. I know there is a problem with referencing structures, I just don't know how to fix it. Simple problem, any one wanna help? The problem is not that Figure Type is declared outside of Figure.h, or that it is private as opposed to public. Error Reports Error 1 error C2653: 'Figure' : is not a class or namespace name c:\users\jim\documents\c++\roguelike\roguelike\ui.h 13 1 roguelike Error 3 error C2653: 'Figure' : is not a class or namespace name c:\users\jim\documents\c++\roguelike\roguelike\ui.h 14 1 roguelike Error 2 error C2061: syntax error : identifier 'FIGURE_TYPE' c:\users\jim\documents\c++\roguelike\roguelike\ui.h 13 1 roguelike Error 4 error C2061: syntax error : identifier 'FIGURE_TYPE' c:\users\jim\documents\c++\roguelike\roguelike\ui.h 14 1 roguelike c++ share|improve this question edited Jan 26 '13 at 20:34 Lightness Races in Orbit 217k35335583 asked Jan 26 '13 at 20:20 Jim Hurley 335524 5 What do you think Figure
here for a quick overview of the site Help Center Detailed answers to any questions you might have error c2061 syntax error identifier c Meta Discuss the workings and policies of this site About Us syntax error identifier class Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads
C2061 Syntax Error Identifier 'string'
with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, http://stackoverflow.com/questions/14541193/error-c2061-in-visual-studio just like you, helping each other. Join them; it only takes a minute: Sign up error C2061: syntax error : identifier [closed] up vote 7 down vote favorite 1 Here is my C++ code // XuatChuoiBTHang.h #pragma once #include "BieuThuc.h" #include "BieuThucHang.h" class XuatChuoiBTHang { public: virtual string xuatChuoi(BieuThucHang* btHang) = 0; }; // BieuThucHang.h #pragma http://stackoverflow.com/questions/15715882/error-c2061-syntax-error-identifier once #include "bieuthuc.h" #include "XuatChuoiBTHang.h" class BieuThucHang : public BieuThuc { private: XuatChuoiBTHang* xuatChuoiBTHang; }; Ouput is: "error C2061: syntax error : identifier 'BieuThucHang' " How to fix it ? c++ syntax-error share|improve this question edited Nov 18 '15 at 12:19 Himanshu 3,767111732 asked Mar 30 '13 at 6:54 DungLe 67128 closed as too localized by Bo Persson, joce, phs, teppic, Greg Bacon Mar 31 '13 at 1:55 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question. add a comment| 1 Answer 1 active oldest votes up vote 25 down vote You have a circular dependency of header files. You need to break this circul
here for a quick overview of the site Help Center Detailed answers to any questions you might http://stackoverflow.com/questions/31346286/visual-studio-error-c2061-syntax-error-identifier have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting http://www.cplusplus.com/forum/windows/5868/ ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 syntax error million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Visual Studio error C2061: syntax error: identifier up vote 0 down vote favorite //Species.h #pragma once #include
:o) I tried to implement a class with a function passing a parameter "vector
2
3
4
5
6
7
class cba { private: [...] public: void abc(vector