libctiny.lib

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: George Hester (hesterloli_at_hotmail.com)
Date: 01/16/05


Date: Sun, 16 Jan 2005 03:30:20 -0500

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
_________________________________


Relevant Pages

  • Re: I am learning C: a little problem with a simple source code
    ... i can exit only using ctrl-c ... float perimeter{ ... int main{ ... 'i' needs to clean input buffer*/ ...
    (comp.lang.c)
  • Re: I am learning C: a little problem with a simple source code
    ... i can exit only using ctrl-c ... float perimeter{ ... int main{ ... 'i' needs to clean input buffer*/ ...
    (comp.lang.c)
  • What is ERROR LNK2005?
    ... FTF_ftfont.lib: warning LNK4217: locally defined symbol ... ??1FTGLPixmapFont@@UAE@XZ (public: virtual __thiscall ... ?Descender@FTFont@@QBEMXZ (public: float __thiscall ... BPY_python.lib: error LNK2019: unresolved external symbol ...
    (microsoft.public.vsnet.general)
  • Re: Datatype checking in DotNET
    ... does the data meet the float bounds????? ... The only hard limit is the upper bound of the exponent, which can result in an infinity value, whereas a loss ... You better use the native floating point type of .NET, and don't bother with the other types. ...
    (comp.lang.pascal.delphi.misc)