Skip to content

forwards.h doesn't declare most useful classes #904

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

Closed
abigailbunyan opened this issue Mar 29, 2019 · 3 comments · Fixed by #935
Closed

forwards.h doesn't declare most useful classes #904

abigailbunyan opened this issue Mar 29, 2019 · 3 comments · Fixed by #935

Comments

@abigailbunyan
Copy link
Contributor

json/forwards.h forward declares the deprecated FastWriter and Reader, but not the non-deprecated replacements StreamWriter and CharReader.

@dota17
Copy link
Member

dota17 commented May 15, 2019

I've tried to add declaration class StreamWriter and class CharReader in the forwards.h then execute make command the result is:
`[ 11%] Building CXX object src/lib_json/CMakeFiles/jsoncpp_lib.dir/json_reader.cpp.o
In file included from /software/jsoncpp-1.8.4/include/json/features.h:10:0,
from /software/jsoncpp-1.8.4/include/json/reader.h:10,
from /software/jsoncpp-1.8.4/src/lib_json/json_reader.cpp:9:

/software/jsoncpp-1.8.4/include/json/forwards.h:21:7: error: multiple types in one declaration
class Reader;
^
/software/jsoncpp-1.8.4/include/json/forwards.h:25:7: error: multiple types in one declaration
class Features;
^
src/lib_json/CMakeFiles/jsoncpp_lib.dir/build.make:62: recipe for target 'src/lib_json/CMakeFiles/jsoncpp_lib.dir/json_reader.cpp.o' failed
make[2]: *** [src/lib_json/CMakeFiles/jsoncpp_lib.dir/json_reader.cpp.o] Error 1
CMakeFiles/Makefile2:114: recipe for target 'src/lib_json/CMakeFiles/jsoncpp_lib.dir/all' failed
make[1]: *** [src/lib_json/CMakeFiles/jsoncpp_lib.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
` But I don't know why the class Features multipled declared here. Is there anyone could explain it?

@abigailbunyan
Copy link
Contributor Author

That sounds like you're just missing a semicolon:

class Foo
class Bar;
//    ^~~ error: multiple types in one declaration
class Foo {}
class Bar;
//    ^~~ error: multiple types in one declaration

@dota17
Copy link
Member

dota17 commented May 16, 2019

@abigailbunyan You said it! Thank you bro!

abigailbunyan added a commit to abigailbunyan/jsoncpp that referenced this issue Jun 3, 2019
res2k pushed a commit to res2k/jsoncpp that referenced this issue Aug 21, 2019
dawesc pushed a commit to EFTlab/jsoncpp that referenced this issue Sep 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants