jansson icon indicating copy to clipboard operation
jansson copied to clipboard

Build errors

Open fimmugit opened this issue 4 years ago • 5 comments

I tried to build jansson and got some errors after the make:

In file included from pack_unpack.c:12: utf.h:19: error: parse error before "codepoint" utf.h:22: error: parse error before "int32_t" utf.h:23: error: parse error before "int32_t" make[2]: *** [pack_unpack.lo] Error 1 make[2]: Leaving directory /d/tmp/jansson-2.12/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory /d/tmp/jansson-2.12' make: *** [all] Error 2

My OS: Windows 8.1 pro Compiler MinGW 64 latest + MSYS I followed the steps in the instruction of the latest doc. I am not good at the make tool so I cannot figure out where the problem came from.

BTW, I also tried CMake plus the Visual Studio 14 but when building in the VS, I got a few hundreds errors so I did not go further.

fimmugit avatar May 04 '20 02:05 fimmugit

I had the same errors as you as well and did the same.

momento-potsi avatar May 05 '20 12:05 momento-potsi

I suspect that the problem is from the int32_t used in utf.h and utf.c. I search where it is defined and find it is defined at line 11403 in configure as ac_cv_c_int32_t which I traced its value to "yes" and not int or signed int in config.log. So I changed all int32_t in utf.h and utf.c to int and it seems to build!

fimmugit avatar May 05 '20 15:05 fimmugit

still didnt work

momento-potsi avatar May 05 '20 21:05 momento-potsi

ok, alternatively you can build in VC:

In DOS cmd:
  1. cd jansson-2.12
  2. md build
  3. cd build
  4. cmake -G "Visual Studio 15 2017" .. # here change the VS version you install, Mine is VS 14 2015

Then in build folder, open the jansson.sln, I just build jansson alone without building other stuffs. You should have the include and lib folder inside your build folder. Your newly built jansson_d.lib is in the lib folder

fimmugit avatar May 05 '20 22:05 fimmugit

Although I have built the lib successfully in VC, the build error is still an issue if someone build it in MinGW or the like

fimmugit avatar May 05 '20 22:05 fimmugit