Include for printf function

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Include for printf function

9,273件の閲覧回数
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 返答(返信)

791件の閲覧回数
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 件の賞賛
返信

791件の閲覧回数
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 件の賞賛
返信

791件の閲覧回数
bobh
Contributor I
I have CodeWarrior for mircocontrollers  6.0 Build 7134 , 30May07.
 
                                         Thanks,
                                         Bob H
0 件の賞賛
返信

791件の閲覧回数
bobh
Contributor I
And I am targeting the MC9S08QE128 demo board.
 
                                       Thanks,
                                       Bob H
0 件の賞賛
返信

791件の閲覧回数
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 件の賞賛
返信