Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jsoncpp ver1.9.1 fails to compile on ARM Compiler 5 #1086

Closed
subithaparamasivan opened this issue Nov 5, 2019 · 4 comments
Closed

Jsoncpp ver1.9.1 fails to compile on ARM Compiler 5 #1086

subithaparamasivan opened this issue Nov 5, 2019 · 4 comments

Comments

@subithaparamasivan
Copy link

subithaparamasivan commented Nov 5, 2019

Please refer Issue id #1051 comments having more details regarding this issue.

we removed #include <type_traits> in include/json/config.h file and also removed from local dir(type_traits.h). In this case we are faced below compiler error in "allocator.h" file .

json/allocator.h(18,9) : error #738: a class-qualified name is required
json/allocator.h(18,20) : error #65: expected a ";"
json/allocator.h(19,9) : error #738: a class-qualified name is required
json/allocator.h(19,17) : error #65: expected a ";"
json/allocator.h(20,9) : error #738: a class-qualified name is required
json/allocator.h(20,23) : error #65: expected a ";"
json/allocator.h(21,9) : error #738: a class-qualified name is required
json/allocator.h(21,19) : error #65: expected a ";"
json/allocator.h(22,9) : error #738: a class-qualified name is required
json/allocator.h(22,25) : error #65: expected a ";"
json/allocator.h(23,9) : error #738: a class-qualified name is required
json/allocator.h(23,19) : error #65: expected a ";"
json/allocator.h(24,9) : error #738: a class-qualified name is required
json/allocator.h(24,25) : error #65: expected a ";"
json/allocator.h(29,3) : error #20: identifier "pointer" is undefined
json/allocator.h(29,20) : error #20: identifier "size_type" is undefined
json/allocator.h(41,28) : error #20: identifier "pointer" is undefined
json/allocator.h(41,39) : error #20: identifier "size_type" is undefined
json/allocator.h(50,21) : error #40: expected an identifier
json/allocator.h(50,46) : error #20: identifier "pointer" is undefined
json/allocator.h(50,57) : error #20: identifier "Args" is undefined
json/allocator.h(50,61) : error #18: expected a ")"
json/allocator.h(55,3) : error #20: identifier "size_type" is undefined
json/allocator.h(57,3) : error #20: identifier "pointer" is undefined
json/allocator.h(57,19) : error #20: identifier "reference" is undefined
json/allocator.h(59,3) : error #20: identifier "const_pointer" is undefined
json/allocator.h(59,25) : error #20: identifier "const_reference" is undefined
json/allocator.h(59,17) : error #403: invalid redeclaration of member function "Json::SecureAllocator::address() const" (declared at line 57)
json/allocator.h(64,16) : error #20: identifier "pointer" is undefined
json/allocator.h(72,47) : error #738: a class-qualified name is required

Could you please help on this.
Kindly do needful ASAP.

Thanks,

@dota17
Copy link
Member

dota17 commented Nov 7, 2019

I can't test it in ARM compiler, but from your log, I can only guess that it's because the using syntax.

Can you try to change using to typedef in allocator.h?, like:

- using value_type = T; 
+ typedef T value_type;

@RambabuTirumalasetty
Copy link

RambabuTirumalasetty commented Nov 7, 2019

Hi dota17 ,

  • using value_type = T;
  • typedef T value_type;

As per your suggestion we modified our code. From this we could able to resolve some of the errors. Still we need to change syntax some of the places.

Ex:

  • using Allocator = typename std::conditional<JSONCPP_USING_SECURE_MEMORY, SecureAllocator, std::allocator>::type;
  • typedef typename std::conditional<JSONCPP_USING_SECURE_MEMORY, SecureAllocator,
    std::allocator>::type Allocator;
Log information is:
json/allocator.h(57,21) : error  #40: expected an identifier
json/allocator.h(57,57) : error  #20: identifier "Args" is undefined
json/allocator.h(57,61) : error  #18: expected a ")"
json/config.h(162,1) : error  #935: "typedef" may not be specified here
json/config.h(162,27) : error  #135: namespace "std" has no member "conditional"
json/config.h(171,46) : warning  #12-D: parsing restarts here after previous syntax error
json/config.h(175,34) : error  #276: name followed by "::" must be a class or namespace name
json/config.h(175,54) : error  #276: name followed by "::" must be a class or namespace name
json/config.h(176,9) : error  #276: name followed by "::" must be a class or namespace name
json/config.h(185,15) : error  #135: namespace "Json" has no member "String"
json/config.h(187,15) : error  #135: namespace "Json" has no member "IStringStream"
jsoncpp/src/json_tool.h(39,15) : error  #20: identifier "String" is undefined
jsoncpp/src/json_tool.h(40,3) : error  #20: identifier "String" is undefined
json/json_features.h(44,22) : error  #65: expected a ";"
json/json_features.h(48,19) : error  #65: expected a ";"
json/json_features.h(51,37) : error  #65: expected a ";"
json/json_features.h(54,25) : error  #65: expected a ";"
json/value.h(24,17) : error  #5: cannot open source input file "array": No such file or directory

Kindly suggest a way to overcome this...

@dota17
Copy link
Member

dota17 commented Nov 8, 2019

Go ahead if it works.

But on the other hand, the latest version of jsoncpp(or 1.y.z) is built with C++11. if your compiler can't support some C++11 features, you can turn to use 0.y.z version.

@dota17 dota17 changed the title Jsoncpp ver1.9.2 fails to compile on ARM Compiler 5 Jsoncpp ver1.9.1 fails to compile on ARM Compiler 5 Nov 12, 2019
@baylesj
Copy link
Contributor

baylesj commented Nov 13, 2019

Closing.

We require compilers to be C++11 compliant. Your compiler does not appear to be compliant, so you could try a legacy version of JsonCpp.

@baylesj baylesj closed this as completed Nov 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants