OptimoJoe / Optizelle

Optizelle [op-tuh-zel] is an open source software library designed to solve general purpose nonlinear optimization problems.
www.optimojoe.com/products/optizelle
63 stars 13 forks source link

Build failure: ‘const class Json::Value’ has no member named ‘isUInt64’ #49

Closed Dapid closed 8 years ago

Dapid commented 8 years ago

On branch develop, jsoncpp 0.6.0, and flag -std=c++14, I get the following failure:

[  6%] Building CXX object src/cpp/optizelle/CMakeFiles/optizelle_cpp.dir/json.cpp.o
/home/david/gits/Optizelle/src/cpp/optizelle/json.cpp: In function ‘Optizelle::Natural Optizelle::json::read::natural(const Optizelle::Messaging&, const Json::Value&, const string&)’:
/home/david/gits/Optizelle/src/cpp/optizelle/json.cpp:94:42: error: ‘const class Json::Value’ has no member named ‘isUInt64’
                 if(json.isUInt() || json.isUInt64())
                                          ^
/home/david/gits/Optizelle/src/cpp/optizelle/json.cpp:98:46: error: ‘const class Json::Value’ has no member named ‘isInt64’
                 else if(json.isInt() || json.isInt64()) {

I have manually indicated jsoncpp lives at /usr/lib64/jsoncpp.so

josyoun commented 8 years ago

Unfortunately, that branch of jsoncpp is no longer supported. I don't know the full story, but it looks like all of the development moved from SourceForge to Github here:

https://github.com/open-source-parsers/jsoncpp

What's aggravating is that some Linux distributions are using the old version of jsoncpp rather than the new. In any case, at this point, either master or release 0.10.5 works. I'd updated the manual to say master, but I'll likely change it to a fixed release number since it gives some certainty. This change to the manual happened with commit 649aeea4b6184c0e2fdefa942477aa51040146aa.

Anyway, try the fresher version of jsoncpp and let me know if that works. There should be an option with ENABLE_BUILD_JSONCPP if you just want Optizelle to build it locally.

Dapid commented 8 years ago

I see. I checked if I was using the last version, and sourceforge was the one popping up, so I assumed I was on the latest. I'll file a bug against Fedora.

Feeding the latest release, it works, so I am closing, but I get some deprecation warnings:

[ 20%] Building CXX object CMakeFiles/jsoncpp_object.dir/src/lib_json/json_reader.cpp.o
/home/david/gits/Optizelle/build/src/thirdparty/JsonCpp-prefix/src/JsonCpp/src/lib_json/json_reader.cpp:35:14: warning: ‘template<class> class std::auto_ptr’ is deprecated [-Wdeprecated-declarations]
 typedef std::auto_ptr<CharReader>   CharReaderPtr;
              ^
In file included from /usr/include/c++/5.1.1/memory:81:0,
                 from /home/david/gits/Optizelle/build/src/thirdparty/JsonCpp-prefix/src/JsonCpp/src/lib_json/json_reader.cpp:18:
/usr/include/c++/5.1.1/bits/unique_ptr.h:49:28: note: declared here
   template<typename> class auto_ptr;
                            ^
[ 40%] Building CXX object CMakeFiles/jsoncpp_object.dir/src/lib_json/json_value.cpp.o
[ 60%] Building CXX object CMakeFiles/jsoncpp_object.dir/src/lib_json/json_writer.cpp.o
/home/david/gits/Optizelle/build/src/thirdparty/JsonCpp-prefix/src/JsonCpp/src/lib_json/json_writer.cpp:51:14: warning: ‘template<class> class std::auto_ptr’ is deprecated [-Wdeprecated-declarations]
 typedef std::auto_ptr<StreamWriter>   StreamWriterPtr;
              ^
In file included from /usr/include/c++/5.1.1/bits/locale_conv.h:41:0,
                 from /usr/include/c++/5.1.1/locale:43,
                 from /usr/include/c++/5.1.1/iomanip:43,
                 from /home/david/gits/Optizelle/build/src/thirdparty/JsonCpp-prefix/src/JsonCpp/src/lib_json/json_writer.cpp:10:
/usr/include/c++/5.1.1/bits/unique_ptr.h:49:28: note: declared here
   template<typename> class auto_ptr;
                            ^
[ 60%] Built target jsoncpp_object

98% of the tests are passing, the failing ones are my old friends #2 .

josyoun commented 8 years ago

Alright, so I checked on jsoncpp and it looks like it's on C++98, so I modified the build script to set that automatically with commit 37bf35d230222236e653bece7f23b64d70c2c549. In theory, those warnings should be gone now.