-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Compilation issues when included in project #2094
Comments
Can you make sure the file is exactly the one from the release? It seems that the stray may have been introduced by copy/pasting (see https://arduino.stackexchange.com/questions/30581/stray-302-in-program-error-when-compiling for example). Can you attach the |
I think that's probably it. The errors don't correspond to the line numbers in any meaningful way. I copied the file directly from the include.zip file and still have the same issue. I'm looking online if this is a macos problem but I don't understand why copying the file directly is not helping. Is there an encoding issue in the source? I tried saving in vi with :set nobomb, I opened and saved the file in xcode I've attached what I'm currently using. |
I am using macOS myself and never had such problems. I could also see no encoding issue in the attached file. If there was a BOM, then the error should be directly in the first characters. Very strange issue. |
I'm closing this issue. I did a split diff of the file and found a lot of weird characters. Very long story short I had a process that was trampling on json.hpp in the background. I killed that process and re-downloaded your file and everything works. User error. Sorry for the trouble and thanks for the help! |
I had a similar issue when I downloaded the header file with wget. Copying the file out of the zip folder instead, solved the issue. |
When I include the file "json.hpp" in my source code I get the following error(s)
/inc/json.hpp:32:35: error: stray '\302' in program
<title>json/json.hpp at develop · nlohmann/json · GitHub</title> \ inc/json.hpp:360:76: error: stray '\206' in program ↵ \ inc/json.hpp:1067:70: error: stray '#' in program #define NLOHMANN_JSON_VERSION_PATCH 3"json.hpp:33275:189: error: expected unqualified-id before '<' token
#include <vector> // vector"
<this follows for virtually every line of the header>
#include "json.hpp"
<my code that does not use any json features yet>
That the code should compile
And what is the actual behavior instead?
Several pages of compile errors
Which compiler and operating system are you using? Is it a supported compiler?
-- The C compiler identification is GNU 8.3.1
-- The CXX compiler identification is GNU 8.3.1
OS - macos but the compilation is happening while building a centos 7 docker image.
I use Cmake and have SET(CMAKE_CXX_STANDARD 17)
develop
branch?Release
The text was updated successfully, but these errors were encountered: