Jump to content
Welcome, Guest
Existing user? Sign In

Sign In



Sign Up
The MatriX
  • Welcome To Ghbsys
  • CS GO Streaming Version is released. Have fun streaming while cheating!
  • Have a Payment Issue? Send us a Support ticket.
  • Make a thread if you need support or join our discord for live support.
  • Have Suggestions? Make a thread and you'll earn Ghbsys Points for implemented suggestions.
  • Join our discord to stay well connected! Don't forget to integrate your discord to the site
  • Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum

    Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum, like most online communities you must register to view or post in our community, but don't worry this is a simple free process that requires minimal information for you to signup. Be apart of [GHB] - GAmEhAcKbAsTaRdS Forum by signing in or creating an account.
    • Start new topics and reply to others
    • Subscribe to topics and forums to get email updates
    • Get your own profile page and make new friends
    • Send personal messages to other members.

    add_log function errors ... (help)


    PhoenixRaider
     Share

    Recommended Posts

    #include <cstdio>
    #include <iostream>
    
    using namespace std;
    
    ofstream ofile;	
    ofile.open(GetDirectoryFile("mylog.txt"), ios::app);
    
    void __cdecl add_log (char *fmt, ...)
    {
    if(ofile != NULL)
    {
    	if(!fmt) { return; }
    
    	va_list va_alist;
    	char logbuf[256] = {0};
    
    	va_start (va_alist, fmt);
    	_vsnprintf (logbuf+strlen(logbuf), sizeof(logbuf) - strlen(logbuf), fmt, va_alist);
    	va_end (va_alist);
    
    	ofile << logbuf << endl;
    }
    }

     

    I tried using this and it gave me a shit load of errors ...

     

    1>c:\users\propriétaire\desktop\GHB d3d base\add_log.h(6) : error C2079: 'ofile' uses undefined class 'std::basic_ofstream<_Elem,_Traits>'
    1>		with
    1>		[
    1>			_Elem=char,
    1>			_Traits=std::char_traits<char>
    1>		]
    1>c:\users\propriétaire\desktop\GHB d3d base\add_log.h(7) : error C2143: syntax error : missing ';' before '.'
    1>c:\users\propriétaire\desktop\GHB d3d base\add_log.h(7) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    1>c:\users\propriétaire\desktop\GHB d3d base\add_log.h(7) : error C2086: 'int ofile' : redefinition
    1>		c:\users\propriétaire\desktop\GHB d3d base\add_log.h(6) : see declaration of 'ofile'
    1>c:\users\propriétaire\desktop\GHB d3d base\add_log.h(22) : error C2297: '<<' : illegal, right operand has type 'char [256]'
    1>c:\users\propriétaire\desktop\GHB d3d base\add_log.h(22) : error C2563: mismatch in formal parameter list
    1>c:\users\propriétaire\desktop\GHB d3d base\add_log.h(22) : error C2568: '<<' : unable to resolve function overload
    1>		C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ostream(974): could be 'std::basic_ostream<_Elem,_Traits> &std::endl(std::basic_ostream<_Elem,_Traits> &)'
    1>		with
    1>		[
    1>			_Elem=wchar_t,
    1>			_Traits=std::char_traits<wchar_t>
    1>		]
    1>		C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ostream(966): or	   'std::basic_ostream<_Elem,_Traits> &std::endl(std::basic_ostream<_Elem,_Traits> &)'
    1>		with
    1>		[
    1>			_Elem=char,
    1>			_Traits=std::char_traits<char>
    1>		]
    1>		C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ostream(940): or	   'std::basic_ostream<_Elem,_Traits> &std::endl(std::basic_ostream<_Elem,_Traits> &)'
    1>base.cpp

     

     

    Then I decided to use it in my code .. to test ..

    		CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)D3D, NULL, NULL, NULL);
    	add_log("Success");

    I got more errors ..

    1>.\base.cpp(273) : error C3861: 'add_log': identifier not found

     

    Please help :S

    Link to comment
    Share on other sites

    Guest
    This topic is now closed to further replies.
     Share

    • Recently Browsing   0 members

      • No registered users viewing this page.
    ×
    ×
    • Create New...