[ENet-discuss] Enet in C++

Robbie Diaz metaldrummer610 at yahoo.com
Fri Jun 13 08:26:11 PDT 2008


Hi guys,
I'm trying to use Enet in a C++ project for school and it won't compile at all. I keep getting these weird errors that are preventing the project from being built. I'm compiling my code with "g++ -I/usr/local/include/enet client.cpp -lenet"

Here's my source,

#include <iostream>

extern "C" {
     #include <enet.h>
}

using namespace std;

int main()
{
    enet_initialize();
    cout << "Hello World" << endl;
    enet_deinitialize();
    return 0;
}


And here's my error,

In file included from /usr/include/c++/4.2/cwchar:52,
                 from /usr/include/c++/4.2/bits/postypes.h:46,
                 from /usr/include/c++/4.2/iosfwd:49,
                 from /usr/include/c++/4.2/ios:43,
                 from /usr/include/c++/4.2/ostream:45,
                 from /usr/include/c++/4.2/iostream:45,
                 from client.cpp:1:
/usr/include/c++/4.2/ctime:66: error: ‘::clock_t’ has not been declared
/usr/include/c++/4.2/ctime:67: error: ‘::time_t’ has not been declared
/usr/include/c++/4.2/ctime:68: error: ‘::tm’ has not been declared
/usr/include/c++/4.2/ctime:70: error: ‘::clock’ has not been declared
/usr/include/c++/4.2/ctime:71: error: ‘::difftime’ has not been declared
/usr/include/c++/4.2/ctime:72: error: ‘::mktime’ has not been declared
/usr/include/c++/4.2/ctime:73: error: ‘::time’ has not been declared
/usr/include/c++/4.2/ctime:74: error: ‘::asctime’ has not been declared
/usr/include/c++/4.2/ctime:75: error: ‘::ctime’ has not been declared
/usr/include/c++/4.2/ctime:76: error: ‘::gmtime’ has not been declared
/usr/include/c++/4.2/ctime:77: error: ‘::localtime’ has not been declared
/usr/include/c++/4.2/ctime:78: error: ‘::strftime’ has not been declared
In file included from /usr/include/c++/4.2/locale:46,
                 from /usr/include/c++/4.2/bits/ostream.tcc:46,
                 from /usr/include/c++/4.2/ostream:572,
                 from /usr/include/c++/4.2/iostream:45,
                 from client.cpp:1:
/usr/include/c++/4.2/bits/locale_facets.tcc: In member function ‘_InIter std::time_get<_CharT, _InIter>::_M_extract_via_format(_InIter, _InIter, std::ios_base&, std::_Ios_Iostate&, tm*, const _CharT*) const’:
/usr/include/c++/4.2/bits/locale_facets.tcc:1841: error: invalid use of incomplete type ‘struct tm’
/usr/include/wchar.h:129: error: forward declaration of ‘struct tm’
/usr/include/c++/4.2/bits/locale_facets.tcc:1848: error: invalid use of incomplete type ‘struct tm’
/usr/include/wchar.h:129: error: forward declaration of ‘struct tm’
/usr/include/c++/4.2/bits/locale_facets.tcc:1856: error: invalid use of incomplete type ‘struct tm’
/usr/include/wchar.h:129: error: forward declaration of ‘struct tm’
/usr/include/c++/4.2/bits/locale_facets.tcc:1863: error: invalid use of incomplete type ‘struct tm’
/usr/include/wchar.h:129: error: forward declaration of ‘struct tm’
/usr/include/c++/4.2/bits/locale_facets.tcc:1875: error: invalid use of incomplete type ‘struct tm’
/usr/include/wchar.h:129: error: forward declaration of ‘struct tm’
/usr/include/c++/4.2/bits/locale_facets.tcc:1882: error: invalid use of incomplete type ‘struct tm’
/usr/include/wchar.h:129: error: forward declaration of ‘struct tm’
/usr/include/c++/4.2/bits/locale_facets.tcc:1885: error: invalid use of incomplete type ‘struct tm’
/usr/include/wchar.h:129: error: forward declaration of ‘struct tm’
/usr/include/c++/4.2/bits/locale_facets.tcc:1897: error: invalid use of incomplete type ‘struct tm’
/usr/include/wchar.h:129: error: forward declaration of ‘struct tm’
/usr/include/c++/4.2/bits/locale_facets.tcc:1902: error: invalid use of incomplete type ‘struct tm’
/usr/include/wchar.h:129: error: forward declaration of ‘struct tm’
/usr/include/c++/4.2/bits/locale_facets.tcc:1910: error: invalid use of incomplete type ‘struct tm’
/usr/include/wchar.h:129: error: forward declaration of ‘struct tm’
/usr/include/c++/4.2/bits/locale_facets.tcc:1914: error: invalid use of incomplete type ‘struct tm’
/usr/include/wchar.h:129: error: forward declaration of ‘struct tm’
/usr/include/c++/4.2/bits/locale_facets.tcc:1934: error: invalid use of incomplete type ‘struct tm’
/usr/include/wchar.h:129: error: forward declaration of ‘struct tm’
/usr/include/c++/4.2/bits/locale_facets.tcc:1970: error: invalid use of incomplete type ‘struct tm’
/usr/include/wchar.h:129: error: forward declaration of ‘struct tm’
/usr/include/c++/4.2/bits/locale_facets.tcc:1978: error: invalid use of incomplete type ‘struct tm’
/usr/include/wchar.h:129: error: forward declaration of ‘struct tm’
/usr/include/c++/4.2/bits/locale_facets.tcc: In member function ‘virtual _InIter std::time_get<_CharT, _InIter>::do_get_weekday(_InIter, _InIter, std::ios_base&, std::_Ios_Iostate&, tm*) const’:
/usr/include/c++/4.2/bits/locale_facets.tcc:2212: error: invalid use of incomplete type ‘struct tm’
/usr/include/wchar.h:129: error: forward declaration of ‘struct tm’
/usr/include/c++/4.2/bits/locale_facets.tcc: In member function ‘virtual _InIter std::time_get<_CharT, _InIter>::do_get_monthname(_InIter, _InIter, std::ios_base&, std::_Ios_Iostate&, tm*) const’:
/usr/include/c++/4.2/bits/locale_facets.tcc:2261: error: invalid use of incomplete type ‘struct tm’
/usr/include/wchar.h:129: error: forward declaration of ‘struct tm’
/usr/include/c++/4.2/bits/locale_facets.tcc: In member function ‘virtual _InIter std::time_get<_CharT, _InIter>::do_get_year(_InIter, _InIter, std::ios_base&, std::_Ios_Iostate&, tm*) const’:
/usr/include/c++/4.2/bits/locale_facets.tcc:2290: error: invalid use of incomplete type ‘struct tm’
/usr/include/wchar.h:129: error: forward declaration of ‘struct tm’


Thanks alot,
Robbie



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cubik.org/pipermail/enet-discuss/attachments/20080613/b7956a1d/attachment.htm>


More information about the ENet-discuss mailing list