hi all

Following is the code which is giving me the aforesaid error :

#include "MessageHeader.h"
#include "MessageProcessor.h"//contains the class MessageProcessor
..

class RequestCacheHandler
  {
private:
public:
    /***********************************************************************
     * Functions related to handling of requests
     ***********************************************************************/
    MessageProcessor msgRequest;
    TcpPacket tcp;
.....
.....
....

Am i missing something?
plz help!

Post the exact text of all the error messages, not a snippet of one of the messages you don't understand.

First guess is that the type name is mis-spelled. Perhaps check the capitalisation.

Post the exact text of all the error messages, not a snippet of one of the messages you don't understand.

First guess is that the type name is mis-spelled. Perhaps check the capitalisation.

Thnkx 4 the reply...
But this was the only error message ...

make
g++    -c -o MessageProcessor.o MessageProcessor.cpp
RequestCacheHandler.h:72: error: #MessageProcessor# does not name a type
make: *** [MessageProcessor.o] Error 1

I have checked for capitalisation many times and i am 100% sure its right.

Heres additional info:
When i compile MessageProcessor.cpp:

#ifndef MessageProcessor_H
#define MessageProcessor_H
#include <netinet/in.h>         /*for htons API */
#include <syslog.h>             /*for syslog API */
#include <exception>            /*for exception */
#include <iostream>
#include <string>                /*for memcopy API */
#include "MessageHeader.h"/*for scalar and tabular template and socket related constants*/
#include "RequestCacheHandler.h"  /*when g++ comes to include this it stops and gives error msg*/

class MessageProcessor :  public TcpPacket
  {

public:
    /*
     * friend requestCacheHandler is interested in calling the constructor and
     * forces that every request can have one message only.To have multiple
     * messages multiple requests are required.
     * */
    friend class RequestCacheHandler;
....
...
Nothing else is of importance..
.....
}
#endif

This is the source file RequestCacheHandler.h

#include "MessageHeader.h"
#include "MessageProcessor.h"//contains the class MessageProcessor
..

class RequestCacheHandler
  {
private:
public:
    /***********************************************************************
     * Functions related to handling of requests
     ***********************************************************************/
    MessageProcessor msgRequest; ////****ERROR LOCATION g++ IS REFERRING TO*****
    TcpPacket tcp;
.....
.....
....

MessageProcessor.h has #include "RequestCacheHandler.h"
RequestCacheHandler.h has #include "MessageProcessor.h"
Are all the include guards correctly specified?

> #include "MessageHeader.h"/*for scalar and tabular template and socket related constants*/
> #include "RequestCacheHandler.h" /*when g++ comes to include this it stops and gives error msg*/
I would also carefully examine the end of MessageHeader.h for say a missing ; at the end of a class declaration.

Are you using a version control system? If not, you should be. One of the questions it would be able to answer very easily would be "what are the differences between the old version (which compiled) and the new version (which doesn't)".

If that doesn't work, I would suggest you clone the project and start deleting everything which doesn't change the error message (extra includes, class member variables and methods). Somewhere along the way you'll either find the problem or end up with a really simple test case you can post to the forum "as is" without lot's of ... edits.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.