LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 05-24-2005, 06:23 AM   #1
ChemicalBurn
LQ Newbie
 
Registered: Feb 2005
Posts: 28

Rep: Reputation: 15
Used but not defined as type error


I have this problem while compiling, and I can't seem to figure out why... I created a class Stats, eventually brought it down to a constructor and destructor to check where the error is from:
Code:
#ifndef STATS_H
#define STATS_H

#include <iostream.h>
#include <iomanip>

#include <GRAPH/Map.h>
#include <GRAPH/List.h>
#include <GRAPH/String.h>

#include "LSPEdgeType.h"
#include "IPNodeType.h"
#include "StructTypeDef.h"

using namespace GRAPH;
using namespace std;

/**
  *@author Johnny Ghibril
  */

class Stats {
  private:
    double valSimTime;
    int numConReq;

    List<LSPEdge>  EdgeList;
    List<LSPEdge>  BlockedEdgeList;
    List<int> ConnectionSignals;
    List<int> BlockedSignals;
    Map<int, String> SignalStrings;

  public:
    Stats();
    ~Stats();

};

#endif
and the cpp file contains nothing really...
But when I declare it in another class DMLRController in the header file I get this error:
DMLRControler.h:77: error: 'Stats' is used as a type, but is not defined as a type.
Although its fine in the cpp file of that class and in the main.
Any idea why this is happening?
Here's the code for the header file DMLRController.h:

Code:
#ifndef DMLRCONTROLER_H
#define DMLRCONTROLER_H

#include <CNCL/EventHandler.h>
#include <GRAPH/String.h>
#include <GRAPH/PriorityQueue.h>
#include <iostream>       
#include <GRAPH/Map.h>
#include <GRAPH/List.h>
#include <GRAPH/String.h>

#include "IPNodeType.h"
#include "LSPNodeType.h"
#include "LSPEdgeType.h"
#include "FindPath.h"
#include "Stats.h"

class NetworkState;
#include "NetworkState.h" 
#include "StructTypeDef.h"
/**
  *@author Johnny Ghibril
  */

using namespace GRAPH;
using namespace std;

class DMLRControler : public CNEventHandler  {
  private:    
    NetworkState * NetSt;
    IPNode IpNode;
    LSPEdge EdgeToReroute;
    LSPEdge waitingLspEdge;
    List<LSPEdge> WaitForRerouteList;
    static bool WithRerouting;
    Map<int,String> DebugMap;

    
    enum {	ST_READY,
            ST_WAITFORTARGET,
            ST_WAITFORREROUTESOURCE,
            ST_WAITFORREROUTETARGET
    };
    enum {DB_OK,DB_NOTOK};
       
    
  public:
    DMLRControler(){;};
    DMLRControler(NetworkState * netst, IPNode ipnode, String name);
    ~DMLRControler();

    virtual void event_handler(const CNEvent *ev);

    List<LSPEdge> FindRerouteConnections(LSPEdge lspedge);   
    
    void SetRerouteFlag(bool flag);

    void PrintDebugInfo(int state, int type, int debuginfo);

    Stats statisticObject;
    /// return statistics object
//    statistics GetStatisticObject(){return statisticObject;};
};

#endif
Thanks.
 
Old 05-24-2005, 07:39 AM   #2
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
Check the errors above that one in the compiler output. If there was anything that could not be defined in the class, then the class will not be defined itself, therefore any attempt to instantiate it will fail. Check to make sure that 'List', 'LSPEdge', and 'String' can be instantiated with the include structure you have. If they can't then that is the problem. If they can be, then check for missing '}' in any files you haven't had a successful compile with before. Some errors will be a result of bugs in entirely different areas of your code (even points past where the error shows up), therefore try fixing compiler errors past that one also (if they can be fixed without fixing this one).
ta0kira

PS Or maybe just remove both of the ';' from
Code:
    DMLRControler(){;};

Last edited by ta0kira; 05-24-2005 at 07:42 AM.
 
Old 05-24-2005, 08:04 AM   #3
ChemicalBurn
LQ Newbie
 
Registered: Feb 2005
Posts: 28

Original Poster
Rep: Reputation: 15
I have no compilation errors in the code. Everything runs fine. This class is simply to add some statistical output. Which is basically string generation, its probably the simplest class so far (Stats) And I've already been using the DMLRControler class for a while now and it hasnt generated any errors in runtime either.
I removed the `; from the DMLRControler(){;}; and left the DMLRControler(){} as well as DMLRControler(); and still the same error.
This is getting really frustrating because all the rest of the objects in the class are also objects in the project just like Stats. But its the only one the generates the error.
Any ideas?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error on install:GLIBC_2.0 not defined fordown Linux - Software 7 04-02-2009 05:28 AM
configure: error: conditional "HAVE_XV" was never defined. edbor Linux - Software 4 02-07-2005 02:28 PM
Error on install:GLIBC_2.0 not defined fordown Linux - Software 2 09-20-2004 12:42 AM
MDK10 official error with "GLIBC_2.0 not defined" lvxiang Mandriva 3 08-16-2004 10:34 AM
You have not defined root partition .. RH9 install error poison5151 Linux - Software 3 01-28-2004 07:05 PM


All times are GMT -5. The time now is 05:29 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration