Include for printf function

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Include for printf function

8,928 Views
bobh
Contributor I
What #include do you put in a 'C' program to use the printf function ? Usually it is <stdio.h> but I am getting  link error.
 
                                                                        Thanks,
                                                                        Bob H  
Labels (1)
0 Kudos
5 Replies

446 Views
CrasyCat
Specialist III
Hello
 
- Which CPU are you targeting (HC08, HC12, Coldfire, ..)
- Which version of CodeWarrior are you using?
To retrieve that info:
  - Start CodeWarrior
  - Select Help -> About Freescale CodeWarrior
  - Click on "Install Products"
  - CodeWarrior version used is displayed on top in the Installed Products dialog.
 
CrasyCat
0 Kudos

446 Views
J2MEJediMaster
Specialist I
If the program compiles and you're getting a link error, you're missing the library that contains the printf function.

To repeat what Crasycat said, we can't help you further until you let us know what version of CodeWarrior you're using and the MCU you're targeting. This is a good a place as any to remind our forum users to please, please, please, include the CodeWarrior version and target MCU in the subject line of your posting! It helps experts on a specific MCU notice your posting and get in touch with you.

---Tom

0 Kudos

446 Views
bobh
Contributor I
I have CodeWarrior for mircocontrollers  6.0 Build 7134 , 30May07.
 
                                         Thanks,
                                         Bob H
0 Kudos

446 Views
bobh
Contributor I
And I am targeting the MC9S08QE128 demo board.
 
                                       Thanks,
                                       Bob H
0 Kudos

446 Views
CompilerGuru
NXP Employee
NXP Employee
See this thread
http://forums.freescale.com/freescale/board/message?board.id=16BITCOMM&message.id=2481

Try also searching for termio and printf in this forum, this topic has been discussed before.

Daniel
0 Kudos