GithubHelp home page GithubHelp logo

Comments (23)

 avatar commented on May 10, 2024 1

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.

 avatar commented on May 10, 2024

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.

 avatar commented on May 10, 2024

^ However the Regular Flavour had errors on the array and parser files. If you would like the error messages let me know.

from tomlplusplus.

marzer avatar marzer commented on May 10, 2024

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:

  1. 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)
  2. 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.

 avatar commented on May 10, 2024

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:

  1. 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)
  2. 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!
image

I find this really strange.

This shouldn't be an issue as I have my includes setup correctly:
include_directories(include/)
image

My CMakeLists.txt:
image

Using the Visual Studio Compiler:
image

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
image

Potentially an incompatability issue with CMake..? I'll attach my CMakeLists.txt in a second.

from tomlplusplus.

marzer avatar marzer commented on May 10, 2024

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.

 avatar commented on May 10, 2024

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.

marzer avatar marzer commented on May 10, 2024

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.

(https://docs.microsoft.com/en-us/cpp/build/reference/std-specify-language-standard-version?view=vs-2019)

from tomlplusplus.

marzer avatar marzer commented on May 10, 2024

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.

 avatar commented on May 10, 2024

A quick stackoverflow and.
image

😓

from tomlplusplus.

marzer avatar marzer commented on May 10, 2024

Hah, classic CMake.

from tomlplusplus.

 avatar commented on May 10, 2024

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
image error.

When changing it to C++17, it throws said errors.
image

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.

marzer avatar marzer commented on May 10, 2024

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.

 avatar commented on May 10, 2024

I have fixed the exceptions not being enabled issue, and defined TOML_EXCEPTIONS 1. The issue persists.
image

from tomlplusplus.

marzer avatar marzer commented on May 10, 2024

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.

 avatar commented on May 10, 2024

I'll let you know the results once it's been pushed 😀👍

from tomlplusplus.

marzer avatar marzer commented on May 10, 2024

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.

 avatar commented on May 10, 2024

Er? (I'm on the latest single header.)
image

from tomlplusplus.

marzer avatar marzer commented on May 10, 2024

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.

 avatar commented on May 10, 2024

Yeah, I found it myself and fixed it just as I saw your new comment 🤣 Everything works all good now 👍 Thanks!
image

from tomlplusplus.

marzer avatar marzer commented on May 10, 2024

:D Hooray!

from tomlplusplus.

marzer avatar marzer commented on May 10, 2024

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.

 avatar commented on May 10, 2024

Okay thanks! I have exceptions enabled properly now so I'll remove it.

from tomlplusplus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.