Thread: Linker error in this function program

  1. #1
    Registered User
    Join Date
    Sep 2012
    Posts
    45

    Linker error in this function program

    Its a program to calculate the value of a raised to b and I am getting this error
    Linker error:Undefined symbol 'printf' in the module(the address where the program is saved)
    Code:
    #include<stdio.h>
    int power(int x,int y);
    int main(void)
    {
          int a,b,c;
          Printf("Enter the value of a");
          scanf("%d",&a);
          Printf("Enter the value of b");
          scanf("%d",&b);
          c=Power(a,b);
          Printf("The value of a raised to b is%d",c);
    }
    int Power(int x,int y)
    {
          int z=1,i;
          for(i=1;i<=y;i++)
           {
             z=z*x;
           }
          return(z);
    }

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    > Printf("Enter the value of a");
    Try all lowercase letters.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,318
    C is CaSe SeNsItIvE! Check your function name.
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

  4. #4
    Registered User
    Join Date
    Sep 2012
    Posts
    45
    Thank you everybody,got it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. What is linker error in function programs?
    By sameertelkar in forum C Programming
    Replies: 2
    Last Post: 12-16-2012, 08:49 AM
  2. [Linker error]Undefined reference for function
    By lisa92 in forum C Programming
    Replies: 6
    Last Post: 03-08-2012, 01:17 PM
  3. Static function pointer linker error
    By guitarist809 in forum C++ Programming
    Replies: 2
    Last Post: 10-24-2011, 03:24 AM
  4. Replies: 1
    Last Post: 06-27-2008, 06:41 PM
  5. Linker error when compiling Qt program
    By shashidhara_01 in forum C Programming
    Replies: 2
    Last Post: 04-29-2008, 09:30 AM