Thread overview
Compiling GCC code
Jul 20, 2002
Simon
Jul 20, 2002
Jan Knepper
Jul 20, 2002
Nic Tiger
July 20, 2002
I am attempting to compile a C file (which was writen for GCC) in DMC but i keep getting errors that do not appear when i compile with GCC.

I have tried to compile it without the -A switch which yielded this result:

lemon.c(550) : Error: 5 actual arguments expected for ErrorMsg, had 4
Action_add(&stp->ap,SHIFT,sp,newstp);
^
lemon.c(662) : Error: need explicit cast for function parameter 4 to get
from: struct state*
to  : char *
Action_add(&stp->ap,REDUCE,lemp->symbols[j],cfp->rp);
^
lemon.c(763) : Error: need explicit cast for function parameter 4 to get
from: struct rule*
to  : char *
ErrorMsg(lemp->filename,rp->ruleline,"This rule can not be reduced.\n");
^
lemon.c(808) : Error: 5 actual arguments expected for ErrorMsg, had 3
sp->name);
^
lemon.c(1007) : Error: 5 actual arguments expected for ErrorMsg, had 4
Fatal error: too many errors
--- errorlevel 1

When i compile with the -A switch the main C file is clean of errors but instead the compiler finds some peculiar errors in the "string.h" file, in this output:

_CRTIMP wchar_t * __CLIB wcschr(const wchar_t *, wchar_t);
^
C:\PROGS\DM\BIN\..\include\string.h(308) : Error: '=', ';' or ',' expected
wchar_t * __CLIB wcsrchr(const wchar_t *, wchar_t);
^
C:\PROGS\DM\BIN\..\include\string.h(309) : Error: '=', ';' or ',' expected
wchar_t * __CLIB wcspbrk(const wchar_t *, const wchar_t *);
^
C:\PROGS\DM\BIN\..\include\string.h(310) : Error: '=', ';' or ',' expected
wchar_t * __CLIB wcsstr(const wchar_t *, const wchar_t *);
^
C:\PROGS\DM\BIN\..\include\string.h(311) : Error: '=', ';' or ',' expected
wchar_t * __CLIB wmemchr(const wchar_t *,wchar_t,size_t);
^
C:\PROGS\DM\BIN\..\include\string.h(312) : Error: '=', ';' or ',' expected
Fatal error: too many errors
--- errorlevel 1

The file is part of a bigger project and i really want to be able to compile the
entire project with just 1 compiler.
So am i missing something or is just not possible?


July 20, 2002
Simon wrote:

> I am attempting to compile a C file (which was writen for GCC) in DMC but i keep getting errors that do not appear when i compile with GCC.
>
> I have tried to compile it without the -A switch which yielded this result:
>
> lemon.c(550) : Error: 5 actual arguments expected for ErrorMsg, had 4

Check if a parameter is missing in the call to ErrorMsg

> Action_add(&stp->ap,SHIFT,sp,newstp);
> ^
> lemon.c(662) : Error: need explicit cast for function parameter 4 to get
> from: struct state*
> to  : char *

Action_add(&stp->ap,SHIFT,sp, ( char * ) newstp);


> Action_add(&stp->ap,REDUCE,lemp->symbols[j],cfp->rp);
> ^
> lemon.c(763) : Error: need explicit cast for function parameter 4 to get
> from: struct rule*
> to  : char *

Action_add(&stp->ap,REDUCE,lemp->symbols[j], ( char * ) cfp->rp);

> ErrorMsg(lemp->filename,rp->ruleline,"This rule can not be reduced.\n");
> ^
> lemon.c(808) : Error: 5 actual arguments expected for ErrorMsg, had 3

Same as before...

> sp->name);
> ^
> lemon.c(1007) : Error: 5 actual arguments expected for ErrorMsg, had 4

Same as before.

> Fatal error: too many errors
> --- errorlevel 1
>
> When i compile with the -A switch the main C file is clean of errors but instead the compiler finds some peculiar errors in the "string.h" file, in this output:
>
> _CRTIMP wchar_t * __CLIB wcschr(const wchar_t *, wchar_t);
> ^
> C:\PROGS\DM\BIN\..\include\string.h(308) : Error: '=', ';' or ',' expected
> wchar_t * __CLIB wcsrchr(const wchar_t *, wchar_t);
> ^
> C:\PROGS\DM\BIN\..\include\string.h(309) : Error: '=', ';' or ',' expected
> wchar_t * __CLIB wcspbrk(const wchar_t *, const wchar_t *);
> ^
> C:\PROGS\DM\BIN\..\include\string.h(310) : Error: '=', ';' or ',' expected
> wchar_t * __CLIB wcsstr(const wchar_t *, const wchar_t *);
> ^
> C:\PROGS\DM\BIN\..\include\string.h(311) : Error: '=', ';' or ',' expected
> wchar_t * __CLIB wmemchr(const wchar_t *,wchar_t,size_t);
> ^
> C:\PROGS\DM\BIN\..\include\string.h(312) : Error: '=', ';' or ',' expected
> Fatal error: too many errors
> --- errorlevel 1
>
> The file is part of a bigger project and i really want to be able to compile the
> entire project with just 1 compiler.
> So am i missing something or is just not possible?

Make sure you include tchar.h BEFORE string.h

Jan



July 20, 2002
"Jan Knepper" <jan@smartsoft.cc> wrote in message news:3D397B8F.53F023CA@smartsoft.cc...
> Simon wrote:
>
> > Fatal error: too many errors
> > --- errorlevel 1
> >
> > When i compile with the -A switch the main C file is clean of errors but
instead
> > the compiler finds some peculiar errors in the "string.h" file, in this
output:
> >
> > _CRTIMP wchar_t * __CLIB wcschr(const wchar_t *, wchar_t);
> > ^
> > C:\PROGS\DM\BIN\..\include\string.h(308) : Error: '=', ';' or ','
expected
> > wchar_t * __CLIB wcsrchr(const wchar_t *, wchar_t);
> > ^
> > C:\PROGS\DM\BIN\..\include\string.h(309) : Error: '=', ';' or ','
expected
> > wchar_t * __CLIB wcspbrk(const wchar_t *, const wchar_t *);
> > ^
> > C:\PROGS\DM\BIN\..\include\string.h(310) : Error: '=', ';' or ','
expected
> > wchar_t * __CLIB wcsstr(const wchar_t *, const wchar_t *);
> > ^
> > C:\PROGS\DM\BIN\..\include\string.h(311) : Error: '=', ';' or ','
expected
> > wchar_t * __CLIB wmemchr(const wchar_t *,wchar_t,size_t);
> > ^
> > C:\PROGS\DM\BIN\..\include\string.h(312) : Error: '=', ';' or ','
expected
> > Fatal error: too many errors
> > --- errorlevel 1
> >
> > The file is part of a bigger project and i really want to be able to
compile the
> > entire project with just 1 compiler.
> > So am i missing something or is just not possible?
>
> Make sure you include tchar.h BEFORE string.h
>
> Jan
>

Also make sure that _CRTIMP macro is defined somewhere.