Autor Wątek: MMO co? jak? i w czym?  (Przeczytany 7945 razy)

Offline Frondeus

  • Użytkownik

# Luty 19, 2008, 19:23:33
Skiter Twoj programik Serwer-client jest super;).
Zdziwil mnie tylko jeden szczegol, uruchamiajac go na VC 2008 Express, nie udala sie kompilacja, z powodow...   
 ...braku pliku fstream.h(!!!).
W samym katalogu include jest Fstream(bez.h), ale usuwajac te cale ".h" z projektu lub zmieniajac nazwe pliku na odpowiednia wystepowaly liczne errory:
------ Build started: Project: serwer, Configuration: Debug Win32 ------
Compiling...
global.cpp
main.cpp
player.cpp
c:\documents and settings\wojtek\pulpit\server\player.cpp(81) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        d:\program files\microsoft visual studio 9.0\vc\include\stdio.h(366) : see declaration of 'sprintf'
c:\documents and settings\wojtek\pulpit\server\player.cpp(82) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
        d:\program files\microsoft visual studio 9.0\vc\include\stdio.h(366) : see declaration of 'sprintf'
c:\documents and settings\wojtek\pulpit\server\player.cpp(102) : error C3861: 'getline': identifier not found
c:\documents and settings\wojtek\pulpit\server\player.cpp(135) : error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'std::basic_string<_Elem,_Traits,_Ax>' (or there is no acceptable conversion)
        with
        [
            _Elem=char,
            _Traits=std::char_traits<char>,
            _Ax=std::allocator<char>
        ]
        d:\program files\microsoft visual studio 9.0\vc\include\ostream(653): could be 'std::basic_ostream<_Elem,_Traits> &std::operator <<<char,std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,const char *)' [found using argument-dependent lookup]
        with
        [
            _Elem=char,
            _Traits=std::char_traits<char>
        ]
        d:\program files\microsoft visual studio 9.0\vc\include\ostream(700): or       'std::basic_ostream<_Elem,_Traits> &std::operator <<<char,std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,char)' [found using argument-dependent lookup]
        with
        [
            _Elem=char,
            _Traits=std::char_traits<char>
        ]
        d:\program files\microsoft visual studio 9.0\vc\include\ostream(738): or       'std::basic_ostream<_Elem,_Traits> &std::operator <<<std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,const char *)' [found using argument-dependent lookup]
        with
        [
            _Elem=char,
            _Traits=std::char_traits<char>
        ]
        d:\program files\microsoft visual studio 9.0\vc\include\ostream(785): or       'std::basic_ostream<_Elem,_Traits> &std::operator <<<std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,char)' [found using argument-dependent lookup]
        with
        [
            _Elem=char,
            _Traits=std::char_traits<char>
        ]
        d:\program files\microsoft visual studio 9.0\vc\include\ostream(909): or       'std::basic_ostream<_Elem,_Traits> &std::operator <<<std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,const signed char *)' [found using argument-dependent lookup]
        with
        [
            _Elem=char,
            _Traits=std::char_traits<char>
        ]
        d:\program files\microsoft visual studio 9.0\vc\include\ostream(916): or       'std::basic_ostream<_Elem,_Traits> &std::operator <<<std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,signed char)' [found using argument-dependent lookup]
        with
        [
            _Elem=char,
            _Traits=std::char_traits<char>
        ]
        d:\program files\microsoft visual studio 9.0\vc\include\ostream(923): or       'std::basic_ostream<_Elem,_Traits> &std::operator <<<std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,const unsigned char *)' [found using argument-dependent lookup]
        with
        [
            _Elem=char,
            _Traits=std::char_traits<char>
        ]
        d:\program files\microsoft visual studio 9.0\vc\include\ostream(930): or       'std::basic_ostream<_Elem,_Traits> &std::operator <<<std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,unsigned char)' [found using argument-dependent lookup]
        with
        [
            _Elem=char,
            _Traits=std::char_traits<char>
        ]
        d:\program files\microsoft visual studio 9.0\vc\include\ostream(170): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(std::basic_ostream<_Elem,_Traits> &(__cdecl *)(std::basic_ostream<_Elem,_Traits> &))'
        with
        [
            _Elem=char,
            _Traits=std::char_traits<char>
        ]
        d:\program files\microsoft visual studio 9.0\vc\include\ostream(176): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(std::basic_ios<_Elem,_Traits> &(__cdecl *)(std::basic_ios<_Elem,_Traits> &))'
        with
        [
            _Elem=char,
            _Traits=std::char_traits<char>
        ]
        d:\program files\microsoft visual studio 9.0\vc\include\ostream(183): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(std::ios_base &(__cdecl *)(std::ios_base &))'
        with
        [
            _Elem=char,
            _Traits=std::char_traits<char>
        ]
        d:\program files\microsoft visual studio 9.0\vc\include\ostream(190): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(std::_Bool)'
        with
        [
            _Elem=char,
            _Traits=std::char_traits<char>
        ]
        d:\program files\microsoft visual studio 9.0\vc\include\ostream(210): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(short)'
        with
        [
            _Elem=char,
            _Traits=std::char_traits<char>
        ]
        d:\program files\microsoft visual studio 9.0\vc\include\ostream(243): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(unsigned short)'
        with
        [
            _Elem=char,
            _Traits=std::char_traits<char>
        ]
        d:\program files\microsoft visual studio 9.0\vc\include\ostream(263): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(__w64 int)'
        with
        [
            _Elem=char,
            _Traits=std::char_traits<char>
        ]
        d:\program files\microsoft visual studio 9.0\vc\include\ostream(288): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(__w64 unsigned int)'
        with
        [
            _Elem=char,
            _Traits=std::char_traits<char>
        ]
        d:\program files\microsoft visual studio 9.0\vc\include\ostream(308): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(long)'
        with
        [
            _Elem=char,
            _Traits=std::char_traits<char>
        ]
        d:\program files\microsoft visual studio 9.0\vc\include\ostream(328): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(__w64 unsigned long)'
        with
        [
            _Elem=char,
            _Traits=std::char_traits<char>
        ]
        d:\program files\microsoft visual studio 9.0\vc\include\ostream(349): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(__int64)'
        with
        [
            _Elem=char,
            _Traits=std::char_traits<char>
        ]
        d:\program files\microsoft visual studio 9.0\vc\include\ostream(369): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(unsigned __int64)'
        with
        [
            _Elem=char,
            _Traits=std::char_traits<char>
        ]
        d:\program files\microsoft visual studio 9.0\vc\include\ostream(390): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(float)'
        with
        [
            _Elem=char,
            _Traits=std::char_traits<char>
        ]
        d:\program files\microsoft visual studio 9.0\vc\include\ostream(410): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(double)'
        with
        [
            _Elem=char,
            _Traits=std::char_traits<char>
        ]
        d:\program files\microsoft visual studio 9.0\vc\include\ostream(430): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(long double)'
        with
        [
            _Elem=char,
            _Traits=std::char_traits<char>
        ]
        d:\program files\microsoft visual studio 9.0\vc\include\ostream(450): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(const void *)'
        with
        [
            _Elem=char,
            _Traits=std::char_traits<char>
        ]
        d:\program files\microsoft visual studio 9.0\vc\include\ostream(470): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(std::basic_streambuf<_Elem,_Traits> *)'
        with
        [
            _Elem=char,
            _Traits=std::char_traits<char>
        ]
        while trying to match the argument list '(std::ofstream, std::basic_string<_Elem,_Traits,_Ax>)'
        with
        [
            _Elem=char,
            _Traits=std::char_traits<char>,
            _Ax=std::allocator<char>
        ]
c:\documents and settings\wojtek\pulpit\server\player.cpp(141) : error C2065: 'ifstream' : undeclared identifier
c:\documents and settings\wojtek\pulpit\server\player.cpp(141) : error C2146: syntax error : missing ';' before identifier 'CheckLogin'
c:\documents and settings\wojtek\pulpit\server\player.cpp(141) : error C3867: 'Player::CheckLogin': function call missing argument list; use '&Player::CheckLogin' to create a pointer to member
c:\documents and settings\wojtek\pulpit\server\player.cpp(150) : error C2228: left of '.open' must have class/struct/union
c:\documents and settings\wojtek\pulpit\server\player.cpp(151) : error C3867: 'Player::CheckLogin': function call missing argument list; use '&Player::CheckLogin' to create a pointer to member
c:\documents and settings\wojtek\pulpit\server\player.cpp(155) : error C2228: left of '.eof' must have class/struct/union
c:\documents and settings\wojtek\pulpit\server\player.cpp(155) : fatal error C1903: unable to recover from previous error(s); stopping compilation
config.cpp
c:\documents and settings\wojtek\pulpit\server\config.cpp(13) : error C2065: 'ifstream' : undeclared identifier
c:\documents and settings\wojtek\pulpit\server\config.cpp(13) : error C2146: syntax error : missing ';' before identifier 'Config'
c:\documents and settings\wojtek\pulpit\server\config.cpp(13) : error C2275: 'Config' : illegal use of this type as an expression
c:\documents and settings\wojtek\pulpit\server\config.cpp(14) : error C2143: syntax error : missing ';' before '.'
c:\documents and settings\wojtek\pulpit\server\config.cpp(14) : error C2143: syntax error : missing ';' before '.'
c:\documents and settings\wojtek\pulpit\server\config.cpp(15) : error C2275: 'Config' : illegal use of this type as an expression
c:\documents and settings\wojtek\pulpit\server\config.cpp(17) : error C2143: syntax error : missing ';' before '.'
c:\documents and settings\wojtek\pulpit\server\config.cpp(17) : error C2143: syntax error : missing ';' before '.'
c:\documents and settings\wojtek\pulpit\server\config.cpp(21) : warning C4832: token '.' is illegal after UDT 'Config'
        c:\documents and settings\wojtek\pulpit\server\config.h(5) : see declaration of 'Config'
c:\documents and settings\wojtek\pulpit\server\config.cpp(21) : error C2039: 'eof' : is not a member of 'Config'
        c:\documents and settings\wojtek\pulpit\server\config.h(5) : see declaration of 'Config'
c:\documents and settings\wojtek\pulpit\server\config.cpp(21) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Generating Code...
Build log was saved at "file://c:\Documents and Settings\Wojtek\Pulpit\c++\projekty\global\global\Debug\BuildLog.htm"
global - 19 error(s), 3 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


moze ktos poradzi?

Offline Mr. Spam

  • Miłośnik przetworów mięsnych

Offline Mattrick

  • Użytkownik

# Luty 19, 2008, 19:54:18
Ach, niedoczytalem ze VS... Moze sprobuj skopiowac pliki z MinGW-a?
« Ostatnia zmiana: Luty 19, 2008, 19:56:32 wysłana przez Mattrick »

Offline Xion

  • Redaktor
    • xion.log

# Luty 19, 2008, 20:09:05
Popraw po prostu kod, żeby poprawnie korzystał z biblioteki standardowej C++.