error: expected class-name before "class"

Joined
Aug 4, 2009
Messages
2
Reaction score
0
hi all,

i have a top class in which three diffrent classes are instantiated

#include <traffic_generator.h>
#include <switch.h>
#include <fabric.h>
class top : public sc_core::sc_module {
public:
/// Constructor
top ( sc_core::sc_module_name name);
traffic_generator traffic_generator_i;
switch_m switch_i;
fabric fabric_i;
};

#include "top.h"
class top;
int sc_main (int argc ,char *argv[] )
{
top top_i("top_i");
sc_core::sc_start();
return 0;
}


i am geting

error: expected class-name before "class"
../src/main.cpp: In function `int sc_main(int, char**)':
../src/main.cpp:6: error: `top' was not declared in this scope
../src/main.cpp:6: error: expected `;' before "top_i"

if i remove the fabric class its working fine if i add the fabric class above error i am getting
and also for every header i have added the
#ifndef _H_
#define _H_
#endif
any body please help me .......

thanks in advance .......
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top