Find the answer to your Linux question:
Results 1 to 2 of 2
I am trying to compile my code with the following: [root@printer3 Obj]# gcc -O2 -o app Main.o ConsFunc.o PlxInit.o Connection.o Data_Handling_Thread.o Display_Data.o FPGA_Data.o Global_Data.o Keypad_Thread.o LibFunc.o Log_File.o NVRAM_Data.o Operation_Thread.o PCCMDI_Thread.o ...
  1. #1
    Just Joined!
    Join Date
    Aug 2008
    Posts
    5

    undefined reference to 'printf'

    I am trying to compile my code with the following:

    [root@printer3 Obj]# gcc -O2 -o app Main.o ConsFunc.o PlxInit.o Connection.o Data_Handling_Thread.o Display_Data.o FPGA_Data.o Global_Data.o Keypad_Thread.o LibFunc.o Log_File.o NVRAM_Data.o Operation_Thread.o PCCMDI_Thread.o Printing_Data_Thread.o STPC_Thread.o Test_LibFunc.o Timer_Thread.o Wait_Pause_Thread.o PciApi.o PciDrvApi.o -L/usr/lib/libc.a -L/usr/lib/gcc/i386-redhat-linux/3.4.2/libgcc.a -lc -lm -lgcc -lpthread -lcrypt -lncurses


    But am getting the following error message:

    PlxInit.o(.text+0x26d): In function `SelectDevice':
    : undefined reference to `Printf'
    PlxInit.o(.text+0x297): In function `SelectDevice':
    : undefined reference to `Printf'
    PlxInit.o(.text+0x2c5): In function `SelectDevice':
    : undefined reference to `Printf'
    PlxInit.o(.text+0x3cc): In function `SelectDevice':
    : undefined reference to `Printf'
    collect2: ld returned 1 exit status

    Please suggest what might be the problem and how to solve it.

    Thanks.

  2. #2
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,568

    Smile

    Printf()
    Print() is user-defined function?
    In case you are accessing ,normal user library its print() not Printf()

    If this doesn't fix the problem.Then you need to provide some code snippets which will be helpful to analyze.
    - Lakshmipathi.G
    -------------------
    FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
    First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -------------------

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...