473,497 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

'g_undo' was not declared in this scope

I get the following error:

editarea.cpp:
In member function `int Edit_Area::Mouse_Draw(int, int, unsigned
char)':
`g_undo' was not declared in this scope

The problem is that g_undo is there. It's in undo.h:

class S_Undo
{
//stuff removed
};
extern S_Undo *g_undo;

The include list of editarea.cpp:

#include <list>
#include <SDL/SDL.h>
#include "stmain.h"
#include "pixel.h"
#include "gprim.h"
#include "stile.h"
#include "area.h"
#include "editarea.h"
#include "brush.h"
#include "ctool.h"
#include "options.h"
#include "tileset.h"
#include "editor.h"
#include "grpdata.h"
#include "generic.h"
#include "icon.h"
#include "undo.h"

If I switch the places of icon.h and undo.h, I get an error telling
that
'g_edit1' of class Icon is not declared while g_undo doesn't give
an error. What is happening here? I'm using DevC++/gcc.

Oct 1 '06 #1
4 2315
Krice posted:
What is happening here? I'm using DevC++/gcc.
I can hazard a guess...

When I write multiple header files, I save myself time and effort by copy-
pasting the inclusion guards from one file to another.

The first thing I'd check is that you actually changed the name of the
inclusion guard macro for each file -- maybe two files have the same macro
name in them, and so only one of them is being included... ?

--

Frederick Gotham
Oct 1 '06 #2
Frederick Gotham wrote:
maybe two files have the same macro
name in them, and so only one of them is being included... ?
That was the case. icon.h had UNDO_H. Thanks!

Oct 1 '06 #3
Krice posted:
>maybe two files have the same macro
name in them, and so only one of them is being included... ?

That was the case. icon.h had UNDO_H. Thanks!

Yes, I do believe I'm feeling psychic today! :D

--

Frederick Gotham
Oct 1 '06 #4

"Frederick Gotham" <fg*******@SPAM.comwrote in message
news:uw*******************@news.indigo.ie...
Krice posted:
>>maybe two files have the same macro
name in them, and so only one of them is being included... ?

That was the case. icon.h had UNDO_H. Thanks!


Yes, I do believe I'm feeling psychic today! :D
I knew you were gonna say that!
Oct 2 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2556
by: Oplec | last post by:
Hi, I thought that I understood how C++ allows for the declaration and defining of variables within an if() statement and how the declared variable can be used until the end of the major if()...
5
27960
by: William | last post by:
In Peer.h, I have: class Peer { // ... }; In Overseer.h, I have: #include "Peer.h" #include <vector>
14
8988
by: Darren L. Weber | last post by:
I am trying to compile a utility to create .avi files. See http://cpbotha.net/im2avi I'm working on Debian etch (a mix of testing/unstable). dweber@dnlweber:~/im2avi-0.4$ g++ --version g++...
4
2678
by: Ray | last post by:
Hello, I think I've had JavaScript variable scope figured out, can you please see if I've got it correctly? * Variables can be local or global * When a variable is declared outside any...
20
1870
by: David | last post by:
I feel like an idiot asking this but here goes: I understand the 'concept' of scope and passing data by value and/or by reference but I am confused on some specifics. class example{ int i; //my...
1
25614
pbmods
by: pbmods | last post by:
VARIABLE SCOPE IN JAVASCRIPT LEVEL: BEGINNER/INTERMEDIATE (INTERMEDIATE STUFF IN ) PREREQS: VARIABLES First off, what the heck is 'scope' (the kind that doesn't help kill the germs that cause...
0
35184
MMcCarthy
by: MMcCarthy | last post by:
We often get questions on this site that refer to the scope of variables and where and how they are declared. This tutorial is intended to cover the basics of variable scope in VBA for MS Access. For...
3
16508
by: psroga | last post by:
Can anyone look at this code and let me know why pthread_mutex_unlock and pthread_mutex_lock are giving me the "phtread_mutex_unlock" was not defined in this scope error. I am compiling the code...
27
1662
by: Erwin Moller | last post by:
Hi group, Consider this simple script (tested on FF3): <script type="text/javascript"> test = 'outer'; for (var i=0;i<2;i++){ alert(test); var test = 'inner'; alert (test);
0
7120
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6991
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7160
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7196
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6878
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
4897
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4583
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3088
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
286
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.