marzer / tomlplusplus

Header-only TOML config file parser and serializer for C++17.
https://marzer.github.io/tomlplusplus/
MIT License
1.53k stars 146 forks source link

vs2022 cannot be used #200

Closed 107295472 closed 1 year ago

107295472 commented 1 year ago

declspec(dllimport) public: class std::basic_streambuf<char,struct std::char_traits > * cdecl std::basic_streambuf<char,struct std::char_traits >::pubsetbuf(char *,__int64)"

Environment

toml++ version and/or commit hash:
new

Compiler:
msvc143

C++ standard mode:
c++ 17

Target arch:
x64

Steps to reproduce (or a small repro code sample)

define GLOG_NO_ABBREVIATED_SEVERITIES

include

include

include <gflags/gflags.h>

include <glog/logging.h>

include

include "string"

include

include

include

include "include/Parameter.h"

include "include/PaddleOCR.h"

include<opencv2/opencv.hpp>

include "resultjson.cpp"

define WRITE_LOG(s) (LOG(INFO)<<s)

include

include <drogon/drogon.h>

include

include <include/toml++/toml.h>

include

include

include

include

pragma comment(lib,"urlmon.lib")

int main(int argc, char* argv[]) {
const auto data = toml::parse_file("config.toml"); }

marzer commented 1 year ago

What? I use VS2022 with TOML++ literally every day. Can you post a compiler error message, and maybe the specific VS version you are using? This bug report tells me nothing useful.

marzer commented 1 year ago

Also please note the TOML++ version or commit hash, as required by the issue template. The word "new" is neither of those things.

marzer commented 1 year ago

I've just tested examples/simple_parser in the latest release version of VS2022 (17.6) and the latest preview (17.7), and both compile it without issue. I'm going to treat this as user-error and close it as not a bug. I'll re-consider it if you can provide me with some more (and better) information.

107295472 commented 1 year ago

tomlplusplus-3.3.0, vs2022 17.3.4

marzer commented 1 year ago

I also asked for a compiler error message. I can't help you if you don't give me good information. You've given me basically nothing to work with.

107295472 commented 1 year ago

no .lib files

marzer commented 1 year ago

That symbol is a from your C++ standard library, not from toml++. This is almost certainly a problem with your project configuation - you have a mix of C and C++ headers, which is already a huge red flag, so who knows what else is going on.

IF you genuinely believe this is an issue with toml++, then first try compiling examples/simple_parser.cpp - if you get the same issue there, then sure, it's an issue with my library, but you need to rule it out with a known working sample first.

Also, in future: paste text, not screenshots. Screenshots are not searchable, you can't copy and paste from them, et cetera.

107295472 commented 1 year ago

I don't know c++, now I can't tell which is the c header and the c++ header

marzer commented 1 year ago

I don't know c++

Then I can't help you. You shouldn't be making bug reports for libraries written in languages you don't know.