kazuho/picojson

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

jokoon opened this issue · 1 comments

    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)

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.