cannot print hex values LIBDEF_PRINTF_ALLOW_HEXINT

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

cannot print hex values LIBDEF_PRINTF_ALLOW_HEXINT

ソリューションへジャンプ
1,625件の閲覧回数
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 解決策
878件の閲覧回数
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 返信
879件の閲覧回数
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 件の賞賛
返信