cannot print hex values LIBDEF_PRINTF_ALLOW_HEXINT

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

cannot print hex values LIBDEF_PRINTF_ALLOW_HEXINT

跳至解决方案
1,634 次查看
rlstraney
Contributor III

Hello,

I cannot print hex values using %x.  

 

I am using Codewarrior 7.1 build 14 

 

I found a thread about this posted by CrasyCat.  Where CrasyCat says "Open the project" and "Activate target"  can someone please explain how to do this?

 

Do I close my project and open the mcp that is being referenced?   I tried opening a few of the mcps in that directory and hitting alt-F7 but none of them give me the  "C/C++ Preprocessor" panel

 

I am assuming the mcp file is a new name now.   But I have no idea what Activate target "2i ColdFire RegABI" means to do.   The rest of the instructions I understand.

 

Here are the instructions that were posted by CrasyCat:

 

You can activate support for display of Hexadecimal number in the following way:
  - Start the IDE
  - Open the project {Install}\ColdFire_Support\msl\MSL_C\MSL_ColdFire\Project\MSL_C.CF.v1.word.mcp (where {Install} refers to your CodeWarrior installation directory)
  - Activate target "2i ColdFire RegABI"
  - Open the target settings dialog (press ALT+F7)
  - Switch to the "C/C++ Preprocessor" panel
  - Add following line in there:
        #define LIBDEF_PRINTF_ALLOW_HEXINT 1
  - Close the Target Settings dialog pressing OK
  - Press the Make button to rebuild the library
  - rebuild your project.
 
printf should support %X from now on.
 

I was hoping that I just needed to open my project and go to the"C/C++ Preprocessor" panel and

add following line in there:

        #define LIBDEF_PRINTF_ALLOW_HEXINT 1

But that didn't work...

 

Please help!

Renee

标签 (1)
0 项奖励
回复
1 解答
887 次查看
rlstraney
Contributor III

This is what I did to get %x to work in printf - although I don't think this is the way it was intended to be done:

 

 

I added printf_tiny_IO.c to my project

In my project I hit alt-f7 and added the following:

#define LIBDEF_PRINTF_ALLOW_HEXINT 1

 

Then %x worked in printf.

 

Renee

 

 

在原帖中查看解决方案

0 项奖励
回复
1 回复
888 次查看
rlstraney
Contributor III

This is what I did to get %x to work in printf - although I don't think this is the way it was intended to be done:

 

 

I added printf_tiny_IO.c to my project

In my project I hit alt-f7 and added the following:

#define LIBDEF_PRINTF_ALLOW_HEXINT 1

 

Then %x worked in printf.

 

Renee

 

 

0 项奖励
回复