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

Copy to a variable inside a Structure #2933

Closed
1 of 4 tasks
txroot opened this issue Aug 14, 2021 · 3 comments
Closed
1 of 4 tasks

Copy to a variable inside a Structure #2933

txroot opened this issue Aug 14, 2021 · 3 comments
Labels
platform: arm related to ARM architecture 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

@txroot
Copy link

txroot commented Aug 14, 2021

What is the issue you have?

Hi,

I think there is an issue/bug with the library when we want to copy the content of a json variable to another that belongs to a Structure variable.

Please describe the steps to reproduce the issue.

Just need to compile the provided code.

Can you provide a small but working code example?

Simple code below:
#include
#include <json.hpp>

using namespace std;
using json = nlohmann::json;

int main(){

struct S
{
	json j;
};
	
S s;
json value = "test";
s.j = value;

return 0;

}

What is the expected behavior?

Compile without errors.

And what is the actual behavior instead?

The compiler gives me a bunch of errors, as can be seen in the attachment.

Which compiler and operating system are you using?

I have many other programs on the same machine, using this library (without using structures).

  • Compiler: GCC 7.1
  • Operating system: Raspberry OS

Which version of the library did you use?

  • [x ] latest release version 3.9.1
  • other release - please state the version: ___
  • the develop branch

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

  • yes
  • no - please copy/paste the error message below
    compiler_errors
@nlohmann
Copy link
Owner

Are you sure you are compiling with C++11? There is no standard given in the command line arguments of your GCC call.

@nlohmann
Copy link
Owner

And what is the error? I can only see warnings in the screenshot.

@nlohmann nlohmann added platform: arm related to ARM architecture state: needs more info the author of the issue needs to provide more details labels Aug 14, 2021
@nlohmann
Copy link
Owner

This seems to be a duplicate of #2850.

@nlohmann nlohmann added solution: duplicate the issue is a duplicate; refer to the linked issue instead and removed kind: bug labels Aug 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: arm related to ARM architecture 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

2 participants