Include for printf function

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Include for printf function

8,985 次查看
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  
标签 (1)
0 项奖励
5 回复数

503 次查看
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 项奖励

503 次查看
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 项奖励

503 次查看
bobh
Contributor I
I have CodeWarrior for mircocontrollers  6.0 Build 7134 , 30May07.
 
                                         Thanks,
                                         Bob H
0 项奖励

503 次查看
bobh
Contributor I
And I am targeting the MC9S08QE128 demo board.
 
                                       Thanks,
                                       Bob H
0 项奖励

503 次查看
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 项奖励