6 years, 3 months ago.

Issue with compiling rapidjson for MbedOS

I am trying to use rapidjson lib in my ARM MbeOS project: https://github.com/Tencent/rapidjson

$mbed add https://github.com/miloyip/rapidjson

My dev environment is MacOS.

mbed version : 1.7.3

$ mbed config -L

[mbed] Global config:

GCC_ARM_PATH=/Users/miclub01/gcc-arm-none-eabi-7-2017-q4-major/bin

TOOLCHAIN=GCC_ARM

[mbed] Local config (/Users/miclub01/GIT/statistics):

TARGET=DISCO_F746NG

In main.cpp I added

  1. include "rapidjson/allocators.h"
  2. include "rapidjson/document.h"
  3. include "rapidjson/writer.h"
  4. include "rapidjson/stringbuffer.h"

$mbed compile

Compile [ 93.4%]: jsonx.cpp

[Error] stdint.h@38,2: #error "Use this header only with Microsoft Visual C++ compilers!"

[Error] inttypes.h@38,2: #error "Use this header only with Microsoft Visual C++ compilers!"

[Error] stdint.h@38,2: #error "Use this header only with Microsoft Visual C++ compilers!"

[Error] stdint.h@135,30: expected initializer before 'int64_t'

[Error] stdint.h@136,30: expected initializer before 'uint64_t'

Thanks! Michael

Solution: make sure you have these lines in your .mbedignore file:

rapidjson/test/*

rapidjson/example/*

rapidjson/include/rapidjson/msinttypes/*

posted by Michael Lubinsky 10 Aug 2018

Hello Michael,

If I am correct, you adding the solution to your question, right?

Thank you so much for that. Would you mind if I (or you really) posted that in the "answer" section so that it can be better found when another developer has the same issue?

Thank you, Earl, team Mbed

posted by Earl Manning 13 Aug 2018

Hi Earl, yes, I answered on my own question. I do not know how to put it into "answer" section - I do not see such section. On the bottom on my screen I see the green box which says:

" Thanks for posting this question Note that you can not answer your own question! "

I am confused by this message - why I cannot answer on my own question?

posted by Michael Lubinsky 13 Aug 2018

I agree. I will ask the web team about it. Thanks for the follow up.

posted by Earl Manning 14 Aug 2018

1 Answer

6 years, 3 months ago.

Hi Michael,

Thanks for posting your solution in the comments above!

- Jenny, team Mbed