compiling error, pls help.

B

beet

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
 
E

Erik Wikström

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.
 
S

SeanW

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
 

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

Similar Threads


Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top