0

I have a code with cpr library, but when I try to compile it I get many errors. I looked at the internet, but couldn't find any solution. I tried to reinstall CPR, but that didn't help.

Errors:

Severity    Code    Description Project File    Line    Suppression State
Error   LNK2005 "protected: char * __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Pninc(void)" (?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ) already defined in libcpmt.lib(cout.obj)   
Error   LNK2005 "protected: __thiscall std::basic_ios<char,struct std::char_traits<char> >::basic_ios<char,struct std::char_traits<char> >(void)" (??0?$basic_ios@DU?$char_traits@D@std@@@std@@IAE@XZ) already defined in libcpmt.lib(cout.obj) 
Error   LNK2005 "protected: __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::basic_streambuf<char,struct std::char_traits<char> >(void)" (??0?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAE@XZ) already defined in libcpmt.lib(cout.obj)   
Error   LNK2005 "public: int __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sbumpc(void)" (?sbumpc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ) already defined in libcpmt.lib(locale.obj) 
Error   LNK2005 "public: int __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sgetc(void)" (?sgetc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ) already defined in libcpmt.lib(locale.obj)       
Error   LNK2005 "public: int __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sputc(char)" (?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z) already defined in libcpmt.lib(locale.obj)  
Error   LNK2005 "public: struct _Cvtvec __thiscall std::_Locinfo::_Getcvt(void)const " (?_Getcvt@_Locinfo@std@@QBE?AU_Cvtvec@@XZ) already defined in libcpmt.lib(locale.obj)
Error   LNK2005 "public: unsigned short const * __thiscall std::_Locinfo::_W_Getdays(void)const " (?_W_Getdays@_Locinfo@std@@QBEPBGXZ) already defined in libcpmt.lib(wlocale.obj)
Error   LNK2005 "public: unsigned short const * __thiscall std::_Locinfo::_W_Getmonths(void)const " (?_W_Getmonths@_Locinfo@std@@QBEPBGXZ) already defined in libcpmt.lib(wlocale.obj)  
Error   LNK2005 "public: virtual __thiscall std::basic_ios<char,struct std::char_traits<char> >::~basic_ios<char,struct std::char_traits<char> >(void)" (??1?$basic_ios@DU?$char_traits@D@std@@@std@@UAE@XZ) already defined in libcpmt.lib(cout.obj)   
Error   LNK2005 "public: virtual __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::~basic_streambuf<char,struct std::char_traits<char> >(void)" (??1?$basic_streambuf@DU?$char_traits@D@std@@@std@@UAE@XZ) already defined in libcpmt.lib(cout.obj)     
Error   LNK2005 "public: void __thiscall std::basic_ios<char,struct std::char_traits<char> >::setstate(int,bool)" (?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z) already defined in libcpmt.lib(cout.obj)   
Error   LNK1120 1 unresolved externals  
Error   LNK2038 mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in main.obj    
Error   LNK2019 unresolved external symbol __except_handler4_common referenced in function __except_handler4    

#include <Windows.h>
#include "main.h"
#include <cpr/cpr.h>[enter image description here][1]

int timerid = 0;
void timer()
{
    
    cpr::Response r = cpr::Get("google.com");

    KillTimer(0, timerid);
} 

0 Answers0