I am a Java programmer, new to C. I have installed Borland C++ 5.5 compiler,
and have been playing around with hello world type progs, and I have
compiled and run a few small programs.
Now I am getting this list of errors, and I don't know what it means! Can
someone help me please?
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
F:\compatC\miniSweph.c:
Error E2139 c:\Borland\Bcc55\include\objidl.h 560: Declaration missing ;
Error E2303 c:\Borland\Bcc55\include\objidl.h 2352: Type name expected
Error E2303 c:\Borland\Bcc55\include\objidl.h 2357: Type name expected
Error E2303 c:\Borland\Bcc55\include\objidl.h 2366: Type name expected
Error E2303 c:\Borland\Bcc55\include\objidl.h 2501: Type name expected
Error E2303 c:\Borland\Bcc55\include\objidl.h 2514: Type name expected
Error E2303 c:\Borland\Bcc55\include\objidl.h 2539: Type name expected
Error E2303 c:\Borland\Bcc55\include\objidl.h 3610: Type name expected
Error E2303 c:\Borland\Bcc55\include\objidl.h 3616: Type name expected
Error E2303 c:\Borland\Bcc55\include\objidl.h 3882: Type name expected
Error E2303 c:\Borland\Bcc55\include\objidl.h 3896: Type name expected
Error E2303 c:\Borland\Bcc55\include\objidl.h 4072: Type name expected
Error E2303 c:\Borland\Bcc55\include\objidl.h 4131: Type name expected
Error E2139 c:\Borland\Bcc55\include\objidl.h 4333: Declaration missing ;
Error E2139 c:\Borland\Bcc55\include\objidl.h 4848: Declaration missing ;
Error E2257 c:\Borland\Bcc55\include\objidl.h 4853: , expected
Error E2303 c:\Borland\Bcc55\include\objidl.h 4988: Type name expected
Error E2303 c:\Borland\Bcc55\include\objidl.h 4996: Type name expected
Error E2303 c:\Borland\Bcc55\include\objidl.h 5179: Type name expected
Error E2303 c:\Borland\Bcc55\include\objidl.h 5195: Type name expected
Error E2303 c:\Borland\Bcc55\include\objidl.h 5403: Type name expected
Error E2303 c:\Borland\Bcc55\include\objidl.h 5408: Type name expected
Error E2303 c:\Borland\Bcc55\include\objidl.h 5413: Type name expected
Error E2303 c:\Borland\Bcc55\include\objidl.h 5417: Type name expected
Error E2303 c:\Borland\Bcc55\include\objidl.h 5481: Type name expected
Error E2228 c:\Borland\Bcc55\include\objidl.h 5481: Too many error or
warning messages
*** 26 errors in Compile ***
Thanks in advance,
John Pedersen
HTH
Jerry Walter
int main()
{...}
That's it...the stuff in main is mostly a lot of printf stuff - I have
deleted it for brevity.
The only include I have is the one at the top there. The objidl.h file comes
with the compiler, and I haven't touched it.
John
No, that's not it.
Please post a minimal (<50 lines) *complete* program without #includes that
demonstrates the problem.
Sorry, but I can compile a program that doesn't have the
#include "swephexp.h"
and it works OK, but when I have that include line, I get that list of
errors that I first posted.
I don't understand that all the errors listed refer to the file
c:\Borland\Bcc55\include\objidl.h
here is the whole thing:
#include "swephexp.h" /* this includes "sweodef.h" */
int main(){
char *sp, sdate[AS_MAXCH], snam[40], serr[AS_MAXCH];
int jday = 1, jmon = 1, jyear = 2000;
double jut = 0.0;
double tjd_ut, te, x2[6];
long iflag, iflgret;
int p;
iflag = SEFLG_SPEED;
while (TRUE) {
printf("\nDate (d.m.y) ?");
gets(sdate);
/* stop if a period . is entered */
if (*sdate == '.')
return OK;
if (sscanf (sdate, "%d%*c%d%*c%d", &jday,&jmon,&jyear) < 1) exit(1);
/*
* we have day, month and year and convert to Julian day number
*/
tjd_ut = swe_julday(jyear,jmon,jday,jut,SE_GREG_CAL);
printf("date: %02d.%02d.%d at 0:00 Universal time\n", jday, jmon,
jyear);
printf("planet \tlongitude\tlatitude\tdistance\tspeed long.\n");
/*
* a loop over all planets
*/
for (p = SE_SUN; p <= SE_CHIRON; p++) {
if (p == SE_EARTH) continue;
/*
* do the coordinate calculation for this planet p
*/
iflgret = swe_calc_ut(tjd_ut, p, iflag, x2, serr);
/*
* if there is a problem, a negative value is returned and an
* error message is in serr.
*/
if (iflgret < 0)
printf("error: %s\n", serr);
/*
* get the name of the planet p
*/
swe_get_planet_name(p, snam);
/*
* print the coordinates
*/
printf("%10s\t%11.7f\t%10.7f\t%10.7f\t%10.7f\n",
snam, x2[0], x2[1], x2[2], x2[3]);
}
}
return OK;
}
How do you think that I should know what's inside this header? I think my
previous post was pretty clear, but please:
1) Save the preprocessor output of the problematic file into a file f.
2) Remove every line from f that doesn't make the problem go away.
3) There are two possible results:
a) you'll find the problem yourself
b) the remainder will be very small, small enough to be posted in a
newsgroup