Re: libctiny.lib
From: George Hester (hesterloli_at_hotmail.com)
Date: 01/17/05
- Next message: George Hester: "Re: switch(){ case arg{}} why?"
- Previous message: Michael K. O'Neill: "Re: libctiny.lib"
- In reply to: Michael K. O'Neill: "Re: libctiny.lib"
- Next in thread: George Hester: "Re: libctiny.lib"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 16 Jan 2005 22:21:10 -0500
I believe my command was to stop libc.lib from being called:
cl SimpleCalculator.c /link libctiny.lib /NODEFAULTLIB:libc.lib
Isn't that what is happening here? /NODEFAULTLIB:libc.lib
I tried it without trying to stop libc.lib from being called and errored with this:
Tried
cl /ML SimpleCalculator.c /link libctiny.lib
and
cl SimpleCalculator.c /link libctiny.lib libc.lib
got
libc.lib<crt0.obj) : error LNK2005: _mainCRTStartup already defined in libctiny.lib(CRT0TCON.OBJ)
SimpleCalculator.exe : fatal error LNK1169: one or more multiply defined symbols found
so then I tried to stop libc.lib from being called:
Tried:
cl SimpleCalculator.c /link libctiny.lib /NODEFAULTLIB:libc.lib
got
SimpleCalculator.obj : error LNK2001: unresolved external symbol _scanf
SimpleCalculator.obj : error LNK2001: unresolved external symbol _putchar
SimpleCalculator.obj : error LNK2001: unresolved external symbol _fltused
So that's why I asked.
Let me try:
cl SimpleCalculator.c /link libc.lib libctiny.lib
Fine but is 52KB. This is worthless. libc.lib alone gives that.
c/ SimpleCalculator.c link libctiny.lib libc.lib
libc.lib<crt0.obj) : error LNK2005: _mainCRTStartup already defined in libctiny.lib(CRT0TCON.OBJ)
SimpleCalculator.exe : fatal error LNK1169: one or more multiply defined symbols found
It doesn't seem to work at all. But thanks anyway.
-- George Hester _________________________________ "Michael K. O'Neill" <mikeathon2000@nospam.hotmail.com> wrote in message news:egcjhRD$EHA.2112@TK2MSFTNGP14.phx.gbl... > Here's a quote from the end of the article: > > "You might be wondering about the runtime library routines that LIBCTINY > doesn't implement. For instance, in TEST.CPP, there's a call to strrchr. > There's no problem here because that function exists in the regular LIBC.LIB > or LIBCMT.LIB that Visual C++ provides. Both LIBCTINY.LIB and LIBC.LIB > implement a variety of routines. LIBCTINY's list is obviously smaller than > what LIBC.LIB provides. The important thing for your purposes is that the > linker finds the LIBCTINY routines first when resolving function calls, and > so LIBCTINY's routines are what's used. If something isn't implemented in > LIBCTINY, the linker finds it in LIBC.LIB instead." > > It looks like you are linking to libc.lib too, so maybe you need to reverse > the order of libc.lib and libctiny.lib in the command line > > Mike > > > > "George Hester" <hesterloli@hotmail.com> wrote in message > news:OHSveW6%23EHA.4072@TK2MSFTNGP10.phx.gbl... > Please take a look at this page: > > http://msdn.microsoft.com/msdnmag/issues/01/01/hood/default.aspx > > I made his libctiny.lib because I was aghast that this c program: > > #define EOF -1 > #define PROMPT ':' > #define exit return /* UNIX Fix */ > main(){ > float a, b; > char opr; > float result; > while (putchar(PROMPT), scanf("%f%c%f", &a, &opr, &b) != EOF){ /* EOF = > ctrl-z */ > switch(opr){ > case '+': result = a+b; break; > case '-': result = a-b; break; > case '*': result = a*b; break; > case '/': result = a/b; break; > default: > printf("ERROR **** illegal operator\n"); > printf("Legal characters are +, -, * and /;"); > printf(" Try again\n"); > continue; > } > printf("result is %g\n", result); > } > printf("See ya"); > exit(0); > } > > was 56KB. > > But when I tried his libctiny.lib like this: > > cl /o1 SimpleCalculator.c /link /NODEFAULT:libc.lib libctiny.lib > > I got three errors: > > SimpleCalculator.obj : error LNK2001: unresolved external symbol _scanf > SimpleCalculator.obj : error LNK2001: unresolved external symbol _putchar > SimpleCalculator.obj : error LNK2001: unresolved external symbol _fltused > > What this tells me is his libctiny.lib is really tiny. So tiny it doesn't > have what is necessary for my program. Is > that right? > > -- > George Hester > _________________________________ > >
- Next message: George Hester: "Re: switch(){ case arg{}} why?"
- Previous message: Michael K. O'Neill: "Re: libctiny.lib"
- In reply to: Michael K. O'Neill: "Re: libctiny.lib"
- Next in thread: George Hester: "Re: libctiny.lib"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|