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

cannot compile on ubuntu 18.04 and 16.04 #1110

Closed
chakpongchung opened this issue May 26, 2018 · 7 comments
Closed

cannot compile on ubuntu 18.04 and 16.04 #1110

chakpongchung opened this issue May 26, 2018 · 7 comments
Labels
solution: duplicate the issue is a duplicate; refer to the linked issue instead state: needs more info the author of the issue needs to provide more details

Comments

@chakpongchung
Copy link

chakpongchung commented May 26, 2018

  • What is the issue you have?

#include <iostream>

using namespace std;
// #include <json.hpp>
#include <nlohmann/json.hpp>
using json = nlohmann::json;  // for convenience

int main() { cout << 0; }
sudo apt install nlohmann-json-dev  

g++ -std=c++11 main.cpp


In file included from test_json.cpp:6:0:
/usr/include/nlohmann/json.hpp: In function ‘bool nlohmann::operator<(nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::const_reference, nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer>::const_reference)’:
/usr/include/nlohmann/json.hpp:6057:62: error: wrong number of template arguments (1, should be 2)
                     return *lhs.m_value.array < *rhs.m_value.array;
                                                              ^~~~~
In file included from /usr/include/nlohmann/json.hpp:33:0,
                 from test_json.cpp:6:
/usr/include/c++/7/array:94:12: note: provided for ‘template<class _Tp, long unsigned int _Nm> struct std::array’
     struct array
            ^~~~~

  • Please describe the steps to reproduce the issue. Can you provide a small but working code example?

  • What is the expected behavior?

  • And what is the actual behavior instead?

  • Which compiler and operating system are you using? Is it a supported compiler?
    Linux ubuntu 4.15.0-20-generic #21-Ubuntu SMP Tue Apr 24 06:16:15 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.3.0-16ubuntu3' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --with-as=/usr/bin/x86_64-linux-gnu-as --with-ld=/usr/bin/x86_64-linux-gnu-ld --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3) 

  • Did you use a released version of the library or the version from the develop branch?

  • If you experience a compilation error: can you compile and run the unit tests?

@chakpongchung chakpongchung changed the title cannot compile on ubuntu 18.04 cannot compile on ubuntu 18.04 and 16.04 May 26, 2018
@nlohmann
Copy link
Owner

Related: #590

@nlohmann
Copy link
Owner

What version of the library are you using? This seems to be exactly the same issue as #590 which was fixed with version 3.0.0.

@nlohmann nlohmann added the state: needs more info the author of the issue needs to provide more details label May 27, 2018
@nlohmann
Copy link
Owner

From the line number of the error, this seems to be version 2.1.1. This issue is a duplicate of #590 and fixed with 3.0.0.

@nlohmann nlohmann added the solution: duplicate the issue is a duplicate; refer to the linked issue instead label May 27, 2018
@chakpongchung
Copy link
Author

@nlohmann The problem is that:

sudo apt install nlohmann-json-dev installs the 2.x version

@nlohmann
Copy link
Owner

Please contact the maintainer of that package about this. I have no control over this.

@SunnyKatyara
Copy link

Dear nlohmann, i am unable to find "E: Unable to locate package nlohmann-json-dev". Its not available, can you please help me to figure it out.

Thank you

@nlohmann
Copy link
Owner

As I wrote above: I am not maintaining this package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solution: duplicate the issue is a duplicate; refer to the linked issue instead state: needs more info the author of the issue needs to provide more details
Projects
None yet
Development

No branches or pull requests

3 participants