Comments (23)
Ah well, thank you for the quick replies. I'll be closing it now, thanks for the great library and I apologise for the inconveniences 🤗
from tomlplusplus.
Also, no modifications were made to the header. I tried both the "Single Header Flavor" and "Regular Flavour". They both threw this error.
from tomlplusplus.
^ However the Regular Flavour had errors on the array and parser files. If you would like the error messages let me know.
from tomlplusplus.
Hmm, weird. MSVC is the environment I use to develop toml++
so it's weird that I didn't see this. I'll do some investigating. Two things I need from you:
- Tell me the value of _MSC_FULL_VER from your compiler (or build with /Bv and tell me the version it spams you with at compile-time)
- Open the
toml++
visual studio solution (tomlplusplus/vs/toml++.sln
) and try building any of the example projects, and tell me what happens.
from tomlplusplus.
Hmm, weird. MSVC is the environment I use to develop
toml++
so it's weird that I didn't see this. I'll do some investigating. Two things I need from you:
- Tell me the value of _MSC_FULL_VER from your compiler (or build with /Bv and tell me the version it spams you with at compile-time)
- Open the
toml++
visual studio solution (tomlplusplus/vs/toml++.sln
) and try building any of the example projects, and tell me what happens.
Thank you for the quick reply,
The value: _MSC_FULL_VER: 192628806
And for the Visual Studio solution, even though my CLion project is using the same compiler, compiled successfully!
I find this really strange.
This shouldn't be an issue as I have my includes setup correctly:
include_directories(include/)
Using the Visual Studio Compiler:
I will load the CMake project into visual studio and see if it compiles correctly on there.
EDIT:
The error occurs on Visual Studio with CMake too
Potentially an incompatability issue with CMake..? I'll attach my CMakeLists.txt in a second.
from tomlplusplus.
Hmm, yeah. It seems like a CMake-related issue. Are you able to see the full command line that gets sent to MSVC anywhere? If so, post that. My suspicion is that MSVC isn't being invoked with the right C++ standard level.
from tomlplusplus.
Command line: "cmd.exe" /c ""c:\program files (x86)\microsoft visual studio\2019\community\common7\ide\commonextensions\microsoft\cmake\CMake\bin\cmake.exe" -G "Ninja" -DCMAKE_INSTALL_PREFIX:PATH="C:\Users\root\Documents\GitHub\ezpkg\out\install\x64-Release" -DCMAKE_C_COMPILER:FILEPATH="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/HostX64/x64/cl.exe" -DCMAKE_CXX_COMPILER:FILEPATH="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/HostX64/x64/cl.exe" -DCMAKE_TOOLCHAIN_FILE="C:/Users/root/Desktop/vcpkg/scripts/buildsystems/vcpkg.cmake" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_MAKE_PROGRAM="c:\program files (x86)\microsoft visual studio\2019\community\common7\ide\commonextensions\microsoft\cmake\Ninja\ninja.exe" "C:\Users\root\Documents\GitHub\ezpkg" 2>&1"
EDIT: Above is cmake invocation ^ not msvc sorry lol
Is that of Visual Studio, can't seem to find the CLion command, they are throwing the same error so I suppose the difference isn't the IDEs fault anyway.
from tomlplusplus.
Nah, that looks like the invocation of cmake. I'm looking for the invocation of cl.exe
(msvc), and the arguments passed to that. My suspicion is that it's being invoked as C++14, which is the default if no standard level argument is given. For C++17 it's /std:c++17
, and for C++20 it's /std:c++latest
(there's no /std:c++20
flag yet since their implementation isn't currently complete).
The reason I'm thinking this is that those syntax errors look a lot like the ones you get when MSVC doesn't understand C++17's nested-namespace definitions in C++14 mode.
from tomlplusplus.
Alternatively you could try lowering CMAKE_CXX_STANDARD
to 17 (since I assume that will work correctly for MSVC), just to see if you get a different result.
from tomlplusplus.
😓
from tomlplusplus.
Hah, classic CMake.
from tomlplusplus.
Oh gosh, this is embarrassing, I sort of jumped to a conclusion and this does appear to be a different issue. If you build on a lower standard (e.g 11/14), then it throws this
error.
When changing it to C++17, it throws said errors.
Very sorry, for closing it prematurely, I thought I had found a solution.
TL:DR I didn't test my solution before closing the issue, the problem persists. Apologies.
from tomlplusplus.
Ah well.
You said you're using exceptions (/EHsc
), but those messages indicate otherwise (the warning in <vector>
, and toml++ is using the internal noex
ABI namespace). If you are meant to be using exceptions, try setting TOML_EXCEPTIONS
to 1
before including toml.hpp, e.g.:
#define TOML_EXCEPTIONS 1
#include <toml++/toml.hpp>
from tomlplusplus.
I have fixed the exceptions not being enabled issue, and defined TOML_EXCEPTIONS 1. The issue persists.
from tomlplusplus.
Ohhhhh. It's std::numeric_limits::max()
getting nuked by a max
macro. I'll fix it library-side, give me a few minutes.
from tomlplusplus.
I'll let you know the results once it's been pushed 😀👍
from tomlplusplus.
You can test it locally; change toml.hpp line 1426 8103 to this:
if (result > static_cast<uint64_t>((std::numeric_limits<int64_t>::max)()) + (sign < 0 ? 1ull : 0ull))
(I added an extra set of parens around std::numeric_limits<int64_t>::max
)
from tomlplusplus.
Er? (I'm on the latest single header.)
from tomlplusplus.
Oh, wow. Where the fuck did I get 1426 from?? Line 8103
was the one, lol.
Doesn't matter now, I've pushed the fix.
from tomlplusplus.
Yeah, I found it myself and fixed it just as I saw your new comment 🤣 Everything works all good now 👍 Thanks!
from tomlplusplus.
:D Hooray!
from tomlplusplus.
Side note: If you changed your compiler settings to enable exceptions properly, you shouldn't need to explicitly set TOML_EXCEPTIONS
yourself, since the default behavior is to match whatever your compiler is set to. I only suggested that as a brute-force. It won't do you any harm to leave it set explicitly, though. That option is always going to be there.
from tomlplusplus.
Okay thanks! I have exceptions enabled properly now so I'll remove it.
from tomlplusplus.
Related Issues (20)
- Crashes when trying to parse file with scientific notation numbers (e-numbers) HOT 1
- vs2022 cannot be used HOT 9
- Shared lib not being installed? HOT 6
- Cannot build with Intel MKL include dirs. HOT 9
- Make key::str() to return std::string instead of std::string_view? HOT 4
- Tomplusplus 3.3.0 build failed on android HOT 4
- File generated can't be parsed. HOT 1
- File that was written with toml++ can't be parsed HOT 6
- OSS-Fuzz Integration HOT 1
- vcpkg is now difficult to use. HOT 4
- How to convert toml::date_time to std::chrono::time_point? HOT 2
- Explicit / Non-lexicographical sorting when serializing? HOT 5
- Indendation customization? HOT 1
- Lambda function error using nvcc HOT 2
- Get toml/yaml/json string without using streams HOT 6
- Installation and use with Meson doesn't seem to work HOT 18
- Store single string value from node view array into string variable HOT 4
- Iterate over nested Tables (Array of Tables) HOT 4
- Undefined references linker error on nvc++ HOT 17
- What is the proper way to parse top level arrays? Seems not working HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tomlplusplus.