The code I'm testing is the following:
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("\n Hello World!\n");
}
Building from a command line (lcc.exe hello.c -o hello.exe) generates
an
executable file, 1 KB size, which does nothing...
Building from Wedit gives the following errors:
c:\tools\lcc\lib\lcccrt0.obj .text: undefined reference to
'_RtlUnwind@16'
c:\tools\lcc\lib\lcccrt0.obj .text: undefined reference to '_signal'
c:\tools\lcc\lib\lcccrt0.obj .text: undefined reference to '_raise'
c:\tools\lcc\lib\lcccrt0.obj .text: undefined reference to '_exit'
asctoq.obj .text: undefined reference to '_strnicmp'
defaulttrap.obj .text: undefined reference to '_fwrite'
defaulttrap.obj .text: undefined reference to '_itoa'
defaulttrap.obj .text: undefined reference to '_strcat'
defaulttrap.obj .text: undefined reference to '_abort'
powlasm.obj .text: undefined reference to '_pow'
qfloat.obj .text: undefined reference to '_memset'
qfloat.obj .text: undefined reference to '_strchr'
qfloat.obj .text: undefined reference to '_memmove'
strlcpy.obj .text: undefined reference to '_memcpy'
xprintf.obj .text: undefined reference to '_localeconv'
xprintf.obj .text: undefined reference to '_strtol'
xprintf.obj .text: undefined reference to '_wcslen'
xprintf.obj .text: undefined reference to '_wctomb'
xprintf.obj .text: undefined reference to '_fputc'
Am I doing something wrong? Is there something not well configurated?
Thanks for everything.
Lcc.exe does only the compiler, you need to link afterwards. The best
solution is to write:
lc hello.c
the "lc.exe" program will call lcc.exe and if compilation goes OK it will call
the linker.
The errors I posted corresponded to the linker output, when linking
the linker returns with code 53 and prints all of the errors. Is there
a problem in the C library?
Thanks anyway.
lcc.exe generates a .obj output file, hello.obj for this example. You've
told it here to call that hello.exe. You then try and run that .exe which is
really a .obj file...
Try:
lcc hello.c
lcclnk hello.obj
Or this:
lc hello.c
as was suggested.
>
> Building from Wedit gives the following errors:
I once had weird problems like this, although not from wedit. It turned out
I had a foreign stdio.h (or some such file) not belonging to lccwin in the
development directory.
Start a new, empty directory. Copy only hello.c into it, run those commands
above. If it doesn't work, try copying/reinstalling lcc to C:\lcc, (setting
a path to c:\lcc\bin,) and trying again.
--
Bartc