compiling error, pls help.

Discussion in 'C++' started by beet, Apr 18, 2008.

  1. beet

    beet Guest

    Hi,

    I am really not good at c/c++.
    Some simple code..

    #include <stdio.h>
    #include <stdlib.h>
    #include <math.h>
    #include "simlibdefs.h"

    extern int *list_rank, *list_size;
    extern int maxatr, maxlist, next_event_type;
    extern double *transfer, sim_time, prob_distrib[26];
    extern struct master {
    double *value;
    struct master *pr;
    struct master *sr;
    } **head, **tail;

    /* Declare simlib functions. */
    ---

    when I compile this with other files, I got the error msg like this:

    simlib.h:6: error: expected init-declarator before "extern"
    simlib.h:6: error: expected `,' or `;' before "extern"

    I am using gcc to compile files...
    Thanks a lot,

    Beet
    beet, Apr 18, 2008
    #1
    1. Advertising

  2. On 2008-04-18 21:03, beet wrote:
    > Hi,
    >
    > I am really not good at c/c++.
    > Some simple code..
    >
    > #include <stdio.h>
    > #include <stdlib.h>
    > #include <math.h>
    > #include "simlibdefs.h"
    >
    > extern int *list_rank, *list_size;
    > extern int maxatr, maxlist, next_event_type;
    > extern double *transfer, sim_time, prob_distrib[26];
    > extern struct master {
    > double *value;
    > struct master *pr;
    > struct master *sr;
    > } **head, **tail;
    >
    > /* Declare simlib functions. */
    > ---
    >
    > when I compile this with other files, I got the error msg like this:
    >
    > simlib.h:6: error: expected init-declarator before "extern"
    > simlib.h:6: error: expected `,' or `;' before "extern"
    >
    > I am using gcc to compile files...
    > Thanks a lot,


    Check the "simlibdefs.h" file, there is probably something wrong at the
    end of it.

    --
    Erik Wikström
    Erik Wikström, Apr 18, 2008
    #2
    1. Advertising

  3. beet

    SeanW Guest

    > simlib.h:6: error: expected init-declarator before "extern"
    > simlib.h:6: error: expected `,' or `;' before "extern"

    ^^^^^^^^^^

    This error message indicates that line 6 of simlib.h
    is incorrect. Look near there for your problem.

    Also, this is straight C, so you should use comp.lang.c
    to avoid the off-topic police.

    Sean
    SeanW, Apr 18, 2008
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sreejumon [MVP]
    Replies:
    1
    Views:
    1,437
    VB Programmer
    Jul 9, 2003
  2. Alvin Bruney
    Replies:
    0
    Views:
    364
    Alvin Bruney
    Jul 9, 2003
  3. VB Programmer

    Datagrid/Range Validator Error - Help Pls

    VB Programmer, Sep 22, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,929
    VB Programmer
    Sep 22, 2004
  4. Garrett Cooper
    Replies:
    0
    Views:
    545
    Garrett Cooper
    Feb 24, 2009
  5. Garrett Cooper
    Replies:
    0
    Views:
    487
    Garrett Cooper
    Feb 24, 2009
Loading...

Share This Page