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

Problem with adding the lib as a submodule #983

Closed
CDitzel opened this issue Feb 26, 2018 · 4 comments
Closed

Problem with adding the lib as a submodule #983

CDitzel opened this issue Feb 26, 2018 · 4 comments
Labels
solution: invalid the issue is not related to the library

Comments

@CDitzel
Copy link

CDitzel commented Feb 26, 2018

I am trying to use your lib as a submodule in my CMake Project in an externalLibs directory that I call via add_subdirectory(json). CMake runs through, but when I try to compile I get a whole lot of errors along the following lines

~/project/extLibs/json/test/src/unit-json_patch.cpp:65:12: warning: missing terminating " character
CHECK(doc1.patch(patch) == R"(
^
~/project/extLibs/json/test/src/unit-json_patch.cpp:65:12: error: missing terminating " character
CHECK(doc1.patch(patch) == R"(
^~~~~~~~~~~~~~~~~~~~~~~~~~
~/project/extLibs/json/test/src/unit-json_patch.cpp:67:21: error: stray ‘\’ in program
"a": {

I cant seem to find the reason for that; i use gcc-7.2

help is deeply appreciated

@nlohmann
Copy link
Owner

Can you make sure you are using C++11?

@CDitzel
Copy link
Author

CDitzel commented Feb 26, 2018

I am sure, I am using some C++17 features and have

ADD_DEFINITIONS(
-std=c++1z
)

in my root CMakeLists.txt file

@CDitzel
Copy link
Author

CDitzel commented Feb 26, 2018

all right, it seems to work now. Apparently ccache was the culprit
I used

find_program(CCACHE_PROGRAM ccache) if(CCACHE_PROGRAM) message(STATUS ${ColourYellow} "-> Launching compiler through ccache and caching compilation outputs" ${ColourReset}) set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}") endif()

in my root CMakeLists.txt file and for reasons I dont yet fully understand that caused the compilation errors

@nlohmann
Copy link
Owner

Thanks for reporting back!

@nlohmann nlohmann self-assigned this Feb 26, 2018
@nlohmann nlohmann added the solution: invalid the issue is not related to the library label Feb 26, 2018
@nlohmann nlohmann removed their assignment Feb 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solution: invalid the issue is not related to the library
Projects
None yet
Development

No branches or pull requests

2 participants