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

Json dump use to compilation errors #3339

Closed
halloweeks opened this issue Feb 18, 2022 · 2 comments
Closed

Json dump use to compilation errors #3339

halloweeks opened this issue Feb 18, 2022 · 2 comments
Labels
state: needs more info the author of the issue needs to provide more details

Comments

@halloweeks
Copy link

halloweeks commented Feb 18, 2022

Code

#include <iostream>
#include <nlohmann/json.hpp>

using json = nlohmann::json;

int main(){
   json data;
   
   data["name"] = "halloweeks";
   data["email"] = "halloweeks@gmail.com";
   
   std::cout << data.dump(4) << std::endl;
   return 0;
}

Compilation Error

$ g++ a.cpp -o $HOME/main /data/data/com.termux/files/usr/bin/arm-linux-androideabi-ld: /data/data/com.termux/files/usr/tmp/a-5e656c.o: in function long std::__ndk1::__libcpp_atomic_refcount_decrement<long>(long&)': a.cpp:(.text._ZNSt6__ndk134__libcpp_atomic_refcount_decrementIlEET_RS1_[_ZNSt6__ndk134__libcpp_atomic_refcount_decrementIlEET_RS1_]+0x28): undefined reference to __atomic_fetch_add_4' /data/data/com.termux/files/usr/bin/arm-linux-androideabi-ld: /data/data/com.termux/files/usr/tmp/a-5e656c.o: in function long std::__ndk1::__libcpp_atomic_refcount_increment<long>(long&)': a.cpp:(.text._ZNSt6__ndk134__libcpp_atomic_refcount_incrementIlEET_RS1_[_ZNSt6__ndk134__libcpp_atomic_refcount_incrementIlEET_RS1_]+0x28): undefined reference to __atomic_fetch_add_4'
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)
$

@halloweeks halloweeks changed the title dump function bug Json dump use to compilation errors Feb 18, 2022
@nlohmann
Copy link
Owner

In order to asses your issue, we need the following information:

  • What is the issue you have?

  • 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?

  • 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?

@nlohmann nlohmann added state: needs more info the author of the issue needs to provide more details and removed kind: bug labels Feb 18, 2022
@nlohmann
Copy link
Owner

nlohmann commented Mar 7, 2022

Closed due to inactivity. Will reopen if needed.

@nlohmann nlohmann closed this as completed Mar 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: needs more info the author of the issue needs to provide more details
Projects
None yet
Development

No branches or pull requests

2 participants