
Originally Posted by
Nicdel
The easiest way is using fprintf for files and cprintf for the console. You could also use the WriteConsole function, not sure if iostream works there, but it should.
Edit: Can you quote the errors?
Ok. It only happens when I put in these lines:
Code:
file.open("file.txt", ios::in | ios::out);
Code:
file<<(something here);
file<<(something here);
and finally:
They are in that order in the whole code, not all together but appear in that order.
The errors are:
Code:
Error 10 error LNK2019: unresolved external symbol "private: static void __cdecl std::ios_base::_Ios_base_dtor(class std::ios_base *)" (?_Ios_base_dtor@iOS_base@STD@@CaxPAV12@@Z) referenced in function "public: virtual __thiscall std::ios_base::~ios_base(void)" (??1ios_base@STD@@UAE@XZ) C:\Users\Aaron\Desktop\MyMod\cl_dll\main.obj client_hl2
Error 11 error LNK2019: unresolved external symbol "public: __thiscall std::_Mutex::~_Mutex(void)" (??1_Mutex@STD@@QAE@XZ) referenced in function "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) C:\Users\Aaron\Desktop\MyMod\cl_dll\main.obj client_hl2
Error 12 error LNK2019: unresolved external symbol "public: void __thiscall std::_Mutex::_Lock(void)" (?_Lock@_Mutex@STD@@QAEXXZ) referenced in function "public: virtual void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Lock(void)" (?_Lock@?$basic_streambuf@DU?$char_traits@D@STD@@@STD@@UaexXZ) C:\Users\Aaron\Desktop\MyMod\cl_dll\main.obj client_hl2
Error 13 error LNK2019: unresolved external symbol "public: void __thiscall std::_Mutex::_Unlock(void)" (?_Unlock@_Mutex@STD@@QAEXXZ) referenced in function "public: virtual void __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::_Unlock(void)" (?_Unlock@?$basic_streambuf@DU?$char_traits@D@STD@@@STD@@UaexXZ) C:\Users\Aaron\Desktop\MyMod\cl_dll\main.obj client_hl2
Error 14 error LNK2001: unresolved external symbol "__int64 const std::_BADOFF" (?_BADOFF@STD@@3_JB) C:\Users\Aaron\Desktop\MyMod\cl_dll\main.obj client_hl2
Error 15 error LNK2019: unresolved external symbol "public: __thiscall std::_Lockit::~_Lockit(void)" (??1_Lockit@STD@@QAE@XZ) referenced in function "public: __thiscall std::_Iterator_base12::~_Iterator_base12(void)" (??1_Iterator_base12@STD@@QAE@XZ) C:\Users\Aaron\Desktop\MyMod\cl_dll\main.obj client_hl2
Error 16 error LNK2019: unresolved external symbol "public: __thiscall std::_Lockit::_Lockit(int)" (??0_Lockit@STD@@QAE@H@Z) referenced in function "public: __thiscall std::_Iterator_base12::~_Iterator_base12(void)" (??1_Iterator_base12@STD@@QAE@XZ) C:\Users\Aaron\Desktop\MyMod\cl_dll\main.obj client_hl2
Error 17 error LNK2019: unresolved external symbol "void __cdecl std::_Debug_message(wchar_t const *,wchar_t const *,unsigned int)" (?_Debug_message@STD@@YAXPB_W0I@Z) referenced in function "public: void __thiscall std::_Iterator_base12::_Orphan_me(void)" (?_Orphan_me@_Iterator_base12@STD@@QAEXXZ) C:\Users\Aaron\Desktop\MyMod\cl_dll\main.obj client_hl2
Error 18 error LNK2019: unresolved external symbol "class std::error_category const & __cdecl std::iostream_category(void)" (?iostream_category@STD@@YAABVerror_category@1@XZ) referenced in function "class std::error_code __cdecl std::make_error_code(enum std::io_errc::io_errc)" (?make_error_code@STD@@YA?AVerror_code@1@W4io_errc@31@@Z) C:\Users\Aaron\Desktop\MyMod\cl_dll\main.obj client_hl2
Error 19 error LNK2019: unresolved external symbol "struct _iobuf * __cdecl std::_Fiopen(char const *,int,int)" (?_Fiopen@STD@@YapAU_iobuf@@PBDHH@Z) referenced in function "public: class std::basic_filebuf<char,struct std::char_traits<char> > * __thiscall std::basic_filebuf<char,struct std::char_traits<char> >::open(char const *,int,int)" (?open@?$basic_filebuf@DU?$char_traits@D@STD@@@STD@@QAEPAV12@PBDHH@Z) C:\Users\Aaron\Desktop\MyMod\cl_dll\main.obj client_hl2
Error 20 error LNK2019: unresolved external symbol "void __cdecl std::_Xlength_error(char const *)" (?_Xlength_error@STD@@YAXPBD@Z) referenced in function "public: void __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::_Xlen(void)const " (?_Xlen@?$basic_string@DU?$char_traits@D@STD@@V?$allocator@D@2@@STD@@QBEXXZ) C:\Users\Aaron\Desktop\MyMod\cl_dll\main.obj client_hl2
Error 21 error LNK2019: unresolved external symbol "void __cdecl std::_Xout_of_range(char const *)" (?_Xout_of_range@STD@@YAXPBD@Z) referenced in function "public: void __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::_Xran(void)const " (?_Xran@?$basic_string@DU?$char_traits@D@STD@@V?$allocator@D@2@@STD@@QBEXXZ) C:\Users\Aaron\Desktop\MyMod\cl_dll\main.obj client_hl2
Error 22 error LNK2019: unresolved external symbol "public: static void __cdecl std::ios_base::_Addstd(class std::ios_base *)" (?_Addstd@iOS_base@STD@@SaxPAV12@@Z) referenced in function "public: __thiscall std::basic_ostream<char,struct std::char_traits<char> >::basic_ostream<char,struct std::char_traits<char> >(enum std::_Uninitialized,bool)" (??0?$basic_ostream@DU?$char_traits@D@STD@@@STD@@QAE@W4_Uninitialized@1@_N@Z) C:\Users\Aaron\Desktop\MyMod\cl_dll\main.obj client_hl2
Error 23 error LNK2019: unresolved external symbol "void * __cdecl operator new(unsigned int,struct std::_DebugHeapTag_t const &,char *,int)" (??2@YapAXIABU_DebugHeapTag_t@STD@@PADH@Z) referenced in function "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) C:\Users\Aaron\Desktop\MyMod\cl_dll\main.obj client_hl2
Error 24 error LNK2019: unresolved external symbol "struct std::_DebugHeapTag_t const & __cdecl std::_DebugHeapTag_func(void)" (?_DebugHeapTag_func@STD@@YAABU_DebugHeapTag_t@1@XZ) referenced in function "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) C:\Users\Aaron\Desktop\MyMod\cl_dll\main.obj client_hl2
Error 25 error LNK2019: unresolved external symbol "public: __thiscall std::_Mutex::_Mutex(void)" (??0_Mutex@STD@@QAE@XZ) referenced in function "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) C:\Users\Aaron\Desktop\MyMod\cl_dll\main.obj client_hl2
Error 26 error LNK2019: unresolved external symbol "private: static class std::locale::_Locimp * __cdecl std::locale::_Getgloballocale(void)" (?_Getgloballocale@locale@STD@@capaV_Locimp@12@XZ) referenced in function "public: __thiscall std::locale::locale(void)" (??0locale@STD@@QAE@XZ) C:\Users\Aaron\Desktop\MyMod\cl_dll\main.obj client_hl2
Error 27 error LNK2019: unresolved external symbol "private: static class std::locale::_Locimp * __cdecl std::locale::_Init(void)" (?_Init@locale@STD@@capaV_Locimp@12@XZ) referenced in function "public: __thiscall std::locale::locale(void)" (??0locale@STD@@QAE@XZ) C:\Users\Aaron\Desktop\MyMod\cl_dll\main.obj client_hl2
Error 28 error LNK2019: unresolved external symbol __CrtDbgReportW referenced in function "public: char const & __thiscall std::_String_const_iterator<char,struct std::char_traits<char>,class std::allocator<char> >::operator*(void)const " (??D?$_String_const_iterator@DU?$char_traits@D@STD@@V?$allocator@D@2@@STD@@QBEABDXZ) C:\Users\Aaron\Desktop\MyMod\cl_dll\main.obj client_hl2
Error 29 error LNK2001: unresolved external symbol "public: static class std::locale::id std::ctype<char>::id" (?id@?$ctype@D@STD@@2V0locale@2@A) C:\Users\Aaron\Desktop\MyMod\cl_dll\main.obj client_hl2
Error 30 error LNK2001: unresolved external symbol "private: static int std::locale::id::_Id_cnt" (?_Id_cnt@id@locale@STD@@0HA) C:\Users\Aaron\Desktop\MyMod\cl_dll\main.obj client_hl2
Error 31 error LNK2019: unresolved external symbol "private: static void __cdecl std::locale::facet::_Facet_Register(class std::locale::facet *)" (?_Facet_Register@facet@locale@STD@@CaxPAV123@@Z) referenced in function "public: void __thiscall std::locale::facet::_Register(void)" (?_Register@facet@locale@STD@@QAEXXZ) C:\Users\Aaron\Desktop\MyMod\cl_dll\main.obj client_hl2
Error 32 error LNK2019: unresolved external symbol "public: static void __cdecl std::_Locinfo::_Locinfo_ctor(class std::_Locinfo *,char const *)" (?_Locinfo_ctor@_Locinfo@STD@@SaxPAV12@PBD@Z) referenced in function "public: __thiscall std::_Locinfo::_Locinfo(char const *)" (??0_Locinfo@STD@@QAE@PBD@Z) C:\Users\Aaron\Desktop\MyMod\cl_dll\main.obj client_hl2
Error 33 error LNK2019: unresolved external symbol "public: static void __cdecl std::_Locinfo::_Locinfo_dtor(class std::_Locinfo *)" (?_Locinfo_dtor@_Locinfo@STD@@SaxPAV12@@Z) referenced in function "public: __thiscall std::_Locinfo::~_Locinfo(void)" (??1_Locinfo@STD@@QAE@XZ) C:\Users\Aaron\Desktop\MyMod\cl_dll\main.obj client_hl2
Error 34 error LNK2019: unresolved external symbol __Getctype referenced in function "public: struct _Ctypevec __thiscall std::_Locinfo::_Getctype(void)const " (?_Getctype@_Locinfo@STD@@QBE?AU_Ctypevec@@XZ) C:\Users\Aaron\Desktop\MyMod\cl_dll\main.obj client_hl2
Error 35 error LNK2019: unresolved external symbol __Tolower referenced in function "protected: virtual char __thiscall std::ctype<char>::do_tolower(char)const " (?do_tolower@?$ctype@D@STD@@MBEDD@Z) C:\Users\Aaron\Desktop\MyMod\cl_dll\main.obj client_hl2
Error 36 error LNK2019: unresolved external symbol __Toupper referenced in function "protected: virtual char __thiscall std::ctype<char>::do_toupper(char)const " (?do_toupper@?$ctype@D@STD@@MBEDD@Z) C:\Users\Aaron\Desktop\MyMod\cl_dll\main.obj client_hl2
Error 37 error LNK2019: unresolved external symbol __free_dbg referenced in function "private: void __thiscall std::_Yarn<char>::_Tidy(void)" (?_Tidy@?$_Yarn@D@STD@@aaeXXZ) C:\Users\Aaron\Desktop\MyMod\cl_dll\main.obj client_hl2
Error 38 error LNK2019: unresolved external symbol "bool __cdecl std::uncaught_exception(void)" (?uncaught_exception@STD@@YA_NXZ) referenced in function "public: __thiscall std::basic_ostream<char,struct std::char_traits<char> >::sentry::~sentry(void)" (??1sentry@?$basic_ostream@DU?$char_traits@D@STD@@@STD@@QAE@XZ) C:\Users\Aaron\Desktop\MyMod\cl_dll\main.obj client_hl2
Which are all LNK2019 errors. Thanks for trying to help me out x3