chadaustin / sajson

Lightweight, extremely high-performance JSON parser for C++11
MIT License
568 stars 43 forks source link

'parse_flags' redefinition ; different storage class #48

Closed mikelaltadi closed 4 years ago

mikelaltadi commented 4 years ago

Hello Im trying to compile with visual studio 2015 and this error appears: 'parse_flags' redefinition ; different storage class

This is located in sajson.h line 152 constexpr uint8_t globals_struct::parse_flags[256] = {

Any idea?

chadaustin commented 4 years ago

Hi @mikelaltadi. I'm not sure. Can you paste the entire error?

wojdyr commented 3 years ago

After this change I get linking errors with GCC 9 and 10 (I haven't checked other versions). I'm testing it on Ubuntu 20.04.

wojdyr@tc:~/fresh/sajson/example$ g++-9 -g -I ../include main.cpp 
/usr/bin/ld: /tmp/ccdOLULc.o: in function `sajson::internal::is_plain_string_character(char)':
/home/wojdyr/fresh/sajson/example/../include/sajson.h:170: undefined reference to `sajson::internal::globals_struct<void>::parse_flags'
/usr/bin/ld: /tmp/ccdOLULc.o: in function `sajson::internal::is_whitespace(char)':
/home/wojdyr/fresh/sajson/example/../include/sajson.h:175: undefined reference to `sajson::internal::globals_struct<void>::parse_flags'
collect2: error: ld returned 1 exit status