expected ')' before 'PRId64' when compiling project for FRDM k64F

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

expected ')' before 'PRId64' when compiling project for FRDM k64F

4,033件の閲覧回数
abhijitnathwani
Contributor I

Hi,

I have downloaded the SDK for frdm k64f board including Azure support. However the samples include a older version of the Azure SDK. When adding the required files from the new SDK, the project building fails with the error:

 

../azure_iot/uamqp/src/amqpvalue_to_string.c:323:45: error: expected ')' before 'PRId64'
  323 |             else if ((sprintf(str_value, "%" PRId64, value) < 0) ||

 

The exact line where this fails is here . The source already has `inttypes.h` included and I have set the Project to use "Library Type" to "Newlib" as I learnt NewLibNano does not support "long long 64".

What else could be wrong here? The compiler is set to ISO C99 std. Happy to share any more details required.

EDIT: I'm using MCUXpresso IDE v11.2

Thanks,
Abhijit Nathwani

0 件の賞賛
返信
3 返答(返信)

4,030件の閲覧回数
converse
Senior Contributor V

Where is PRId64 defined, and what is it defined as?

 

the C compiler will concatenate strings such as

”first bit” “second bit”

but all parts must be strings. 

0 件の賞賛
返信

4,010件の閲覧回数
abhijitnathwani
Contributor I

PRId64 is a macro defined in 'inttypes.h' header file. It depends on int64 support available or not.

0 件の賞賛
返信

4,004件の閲覧回数
converse
Senior Contributor V

I just tried it here - it works perfectly for me.

 

Make sure you are using Newlib for both the library AND the header.

0 件の賞賛
返信