0

I have class

#ifndef TLNK2005_LOADJSON_H
#define TLNK2005_LOADJSON_H
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
#include <boost/json.hpp>
#include <boost/json/src.hpp>

class LoadJson {

};

#endif //TLNK2005_LOADJSON_H

and the .cpp file of this class


#include "LoadJson.h"

and main.cpp

#define BOOST_BIND_GLOBAL_PLACEHOLDERS
#include "iostream"
#include "LoadJson.h"
int main() {
    std::cout << "Hello, World!" << std::endl;
    return 0;
}

why I get LNK2005 erros there some of this erros

** LoadJson.cpp.obj : error LNK2005: "public: virtual void * __cdecl boost::json::detail::default_resource::do_allocate(unsigned __int64,unsigned __int64)" (?do_allocate@default_resource@detail@json@boost@@UEAAPEAX_K0@Z) уже определен в main.cpp.obj LoadJson.cpp.obj : error LNK2005: "public: virtual void __cdecl boost::json::detail::default_resource::do_deallocate(void *,unsigned int64,unsigned int64)" (?do_deallocate@default_resource@detail@json@boost@@UEAAXPEAX_K1@Z) уже определен в main.cpp.obj LoadJson.cpp.obj : error LNK2005: "public: virtual bool cdecl boost::json::detail::default_resource::do_is_equal(class boost::container::pmr::memory_resource const &)const " (?do_is_equal@default_resource@detail@json@boost@@UEBA_NAEBVmemory_resource@pmr@container@4@@Z) уже определен в main.cpp.obj LoadJson.cpp.obj : error LNK2005: "private: static struct boost::json::array::table boost::json::array::empty" (?empty@array@json@boost@@0Utable@123@A) уже определен в main.cpp.obj LoadJson.cpp.obj : error LNK2005: "private: static struct boost::json::object::table boost::json::object::empty" (?empty@object@json@boost@@0Utable@123@A) уже определен в main.cpp.obj LoadJson.cpp.obj : error LNK2005: "private: static char const * const boost::json::key_value_pair::empty" (?empty@key_value_pair@json@boost@@0QBDB) уже определен в main.cpp.obj LoadJson.cpp.obj : error LNK2005: "class boost::basic_string_view<char,struct std::char_traits > __cdecl boost::json::to_string(enum boost::json::kind)" (?to_string@json@boost@@YA?AV?$basic_string_view@DU?$char_traits@D@std@@@2@W4kind@12@@Z) уже определен в main.cpp.obj LoadJson.cpp.obj : error LNK2005: "class std::basic_ostream<char,struct std::char_traits > & __cdecl boost::json::operator<<(class std::basic_ostream<char,struct std::char_traits > &,enum boost::json::kind)" (??6json@boost@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AEAV23@W4kind@01@@Z) уже определен в main.cpp.obj LoadJson.cpp.obj : error LNK2005: "public: __cdecl boost::json::detail::shared_resource::shared_resource(void)" (??0shared_resource@detail@json@boost@@QEAA@XZ) уже определен в main.cpp.obj LoadJson.cpp.obj : error LNK2005: "public: virtual __cdecl boost::json::detail::shared_resource::~shared_resource(void)" (??1shared_resource@detail@json@boost@@UEAA@XZ) уже определен в main.cpp.obj **

Khusayn
  • 37
  • 6

0 Answers0