int main

Code and error are given below:
1
2
3
4
5
6
7
8
 int sc_main(int argc, char* argv[]) 
 {
    tb_top t_top("tb_top");
    sc_start(1000,SC_NS);        //start simulation
   
    sc_stop();         //stop simulation
    return (0);
 }


error: expected ‘}’ at end of input
error: expected unqualified-id at end of input



Regards
cam
Last edited on
The code you posted seems correct.
On which line do the errors appear?
error is shown on 8th line
Again, I do not see anything wrong with your code, syntactically.
You should post more code.
I'm guessing a function was left unclosed. For example,
1
2
3
4
5
6
7
void f(){
    //...
//<-- missing brace here

void g(){
    //....
} //<-- error here 
If you made this as a windows application, make sure that you have the #include "stdafx.h" header above all other headers, this can cause funny behavior sometimes
The MS stuff won't make a difference.

There are several possibilities.

(1) You have too many {'s somewhere.

(2) You forgot a semicolon after (a) a struct declaration or (b) a variable declaration.

(3) What helios said.

Good luck.
thanks helios and Duoas,

Its solved, it was } missing in other file that i had included in tb_top and to which i am running in sc_main.
Topic archived. No new replies allowed.