473,614 Members | 2,076 Online
Bytes | Software Development & Data Engineering Community
+ 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::Mous e_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 2335
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******** ***********@new s.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
2571
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() block. if (int a = /*...*/) { // ... } else if (a = /*variable a be assigned*/) {
5
27971
by: William | last post by:
In Peer.h, I have: class Peer { // ... }; In Overseer.h, I have: #include "Peer.h" #include <vector>
14
9016
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++ (GCC) 4.0.4 20060507 (prerelease) (Debian 4.0.3-3) Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
4
2700
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 function, it is global regardless of whether it's declared with or without "var" * When it is declared inside a function, if declared with "var", it's local, if not, it's global
20
1896
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 global var private void method1(int myInt){ int x; //local var etc...
1
25655
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 bad breath)? Scope describes the context in which a variable can be used. For example, if a variable's scope is a certain function, then that variable can only be used in that function. If you were to try to access that variable anywhere else in...
0
35208
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 the sake of brevity I am sticking to common usage. Wherever the term procedure is used in this tutorial it actually refers to a subroutine or function. Definition of Scope The scope of a variable where this variable can be seen or accessed...
3
16541
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 on g++. # g++ -v Using built-in specs. Target: i386-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man -- infodir=/usr/share/info --enable-shared --enable-threads=posix -- enable-checking=release --with-system-zlib...
27
1684
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
8182
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8130
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8579
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8279
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8433
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7093
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5540
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4052
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2568
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.