Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Am I doing something wrong? Just trying to compile a "Hello World" kind program.

88 views
Skip to first unread message

James Russell

unread,
Oct 27, 2009, 8:29:51 AM10/27/09
to
Hi, I've just installed the latest version of LCC in a Windows
environment.

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.

jacob navia

unread,
Oct 27, 2009, 10:28:36 AM10/27/09
to
James Russell a �crit :

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.

James Russell

unread,
Oct 27, 2009, 11:41:53 AM10/27/09
to
On Oct 27, 3:28 pm, jacob navia <ja...@nospam.org> wrote:
> James Russell a écrit :

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.

bartc

unread,
Nov 4, 2009, 7:48:17 PM11/4/09
to

"James Russell" <j.russe...@gmail.com> wrote in message
news:29ff4642-184f-414d...@g23g2000yqh.googlegroups.com...

> Hi, I've just installed the latest version of LCC in a Windows
> environment.
>
> 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...

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

0 new messages