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

get<int> causes linker error in visual studio, must use int64_t with PICOJSON_USE_INT64 #145

Open
jokoon opened this issue Jan 25, 2022 · 1 comment

Comments

@jokoon
Copy link

jokoon commented Jan 25, 2022

    if (v.is<picojson::array>()) {
        auto & arr = v.get<picojson::array>();
        for (picojson::array::const_iterator iter = arr.begin();
            iter != arr.end(); ++iter) {
            if (iter->is<picojson::object>()) {
                iter->get<picojson::object>().at("id_int").get<int>();
            }
        }
    }

This generates a linking error on VS2019.

Error LNK2019 unresolved external symbol "public: int const & __thiscall picojson::value::get(void)const " (??$get@H@value@picojson@@QBEABHXZ) referenced in function "void __cdecl item_json::parse(void)" (?parse@item_json@@yaxxz)

@GabrieleGiuseppini
Copy link
Contributor

GabrieleGiuseppini commented Jan 26, 2022

I'm afraid picojson doesn't have a definition for ::get<int>(). If you've defined PICOJSON_USE_INT64, you'll have a ::get<std::int64>() though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants