robotconscience / ofxLibwebsockets

[Deprecated] openFrameworks wrapper of libwebsockets for WebSocket client and server functionality
Other
171 stars 68 forks source link

ctime issues in VS10 #4

Closed j3ffgray closed 11 years ago

j3ffgray commented 11 years ago

Trying to port over an Xcode project to VS10 using this library, and I'm running into a bunch of ctime errors. It also appears to be happening when I try running the examples as well. A dump of the errors is below, any ideas?

c:\program files (x86)\microsoft visual studio 10.0\vc\include\ctime(18): error C2039: 'clock_t' : is not a member of 'global namespace'' 1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\ctime(18): error C2873: 'clock_t' : symbol cannot be used in a using-declaration 1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\ctime(20): error C2039: 'asctime' : is not a member of 'global namespace'' 1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\ctime(20): error C2873: 'asctime' : symbol cannot be used in a using-declaration 1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\ctime(20): error C2039: 'clock' : is not a member of 'global namespace'' 1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\ctime(20): error C2873: 'clock' : symbol cannot be used in a using-declaration 1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\ctime(20): error C2039: 'ctime' : is not a member of 'global namespace'' 1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\ctime(20): error C2873: 'ctime' : symbol cannot be used in a using-declaration 1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\ctime(21): error C2039: 'difftime' : is not a member of 'global namespace'' 1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\ctime(21): error C2873: 'difftime' : symbol cannot be used in a using-declaration 1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\ctime(21): error C2039: 'gmtime' : is not a member of 'global namespace'' 1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\ctime(21): error C2873: 'gmtime' : symbol cannot be used in a using-declaration 1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\ctime(21): error C2039: 'localtime' : is not a member of 'global namespace'' 1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\ctime(21): error C2873: 'localtime' : symbol cannot be used in a using-declaration 1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\ctime(22): error C2039: 'mktime' : is not a member of 'global namespace'' 1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\ctime(22): error C2873: 'mktime' : symbol cannot be used in a using-declaration 1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\ctime(22): error C2039: 'strftime' : is not a member of 'global namespace'' 1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\ctime(22): error C2873: 'strftime' : symbol cannot be used in a using-declaration 1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\ctime(22): error C2039: 'time' : is not a member of 'global namespace'' 1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\ctime(22): error C2873: 'time' : symbol cannot be used in a using-declaration

robotconscience commented 11 years ago

Hey grayfuse,

I've run into this error, too. Unfortunately not in front of a PC right now, but can check tomorrow. In the meantime, can you check the additional include directories?

There was an error in the older projects where I was including every directory in ofxLibwebsockets. The one of note is ......\addons\ofxLibwebsockets\libs\libwebsockets\include\win32port. Make sure that there aren't any subdirectories there (e.g. ......\addons\ofxLibwebsockets\libs\libwebsockets\include\win32port\win32helpers, ......\addons\ofxLibwebsockets\libs\libwebsockets\include\win32port\win32helpers\sys)

Let me know if that works! Again, will double check tomorrow AM.

j3ffgray commented 11 years ago

Well, that helped with the ctime issues. Getting a bunch of unresolved external symbols now. I'll keep digging around, but let me know if you've ever run into this.

1>MSVCRTD.lib(cinitexe.obj) : warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library 1>Client.obj : error LNK2019: unresolved external symbol _libwebsocket_client_connect referenced in function "public: bool thiscall ofxLibwebsockets::Client::connect(struct ofxLibwebsockets::ClientOptions)" (?connect@Client@ofxLibwebsockets@@QAE_NUClientOptions@2@@Z) 1>Client.obj : error LNK2019: unresolved external symbol _libwebsocket_create_context referenced in function "public: bool thiscall ofxLibwebsockets::Client::connect(struct ofxLibwebsockets::ClientOptions)" (?connect@Client@ofxLibwebsockets@@QAE_NUClientOptions@2@@Z) 1>Server.obj : error LNK2001: unresolved external symbol _libwebsocket_create_context 1>Client.obj : error LNK2001: unresolved external symbol _libwebsocket_internal_extensions 1>Server.obj : error LNK2019: unresolved external symbol _libwebsocket_internal_extensions referenced in function "int cdecl ofxLibwebsockets::lws_callback(struct libwebsocket_context ,struct libwebsocket ,enum libwebsocket_callback_reasons,void ,void ,unsigned int)" (?lws_callback@ofxLibwebsockets@@YAHPAUlibwebsocket_context@@PAUlibwebsocket@@W4libwebsocket_callback_reasons@@PAX3I@Z) 1>Client.obj : error LNK2019: unresolved external symbol _libwebsockets_get_protocol referenced in function "int cdecl ofxLibwebsockets::lws_client_callback(struct libwebsocket_context ,struct libwebsocket ,enum libwebsocket_callback_reasons,void ,void ,unsigned int)" (?lws_client_callback@ofxLibwebsockets@@YAHPAUlibwebsocket_context@@PAUlibwebsocket@@W4libwebsocket_callback_reasons@@PAX3I@Z) 1>Server.obj : error LNK2001: unresolved external symbol _libwebsockets_get_protocol 1>Client.obj : error LNK2019: unresolved external symbol _libwebsocket_context_destroy referenced in function "public: void thiscall ofxLibwebsockets::Client::close(void)" (?close@Client@ofxLibwebsockets@@QAEXXZ) 1>Reactor.obj : error LNK2001: unresolved external symbol _libwebsocket_context_destroy 1>Client.obj : error LNK2019: unresolved external symbol _libwebsocket_close_and_free_session referenced in function "public: void __thiscall ofxLibwebsockets::Client::close(void)" (?close@Client@ofxLibwebsockets@@QAEXXZ) 1>Reactor.obj : error LNK2001: unresolved external symbol _libwebsocket_close_and_free_session 1>Client.obj : error LNK2019: unresolved external symbol _libwebsocket_service referenced in function "private: virtual void thiscall ofxLibwebsockets::Client::threadedFunction(void)" (?threadedFunction@Client@ofxLibwebsockets@@EAEXXZ) 1>Server.obj : error LNK2001: unresolved external symbol _libwebsocket_service 1>Connection.obj : error LNK2019: unresolved external symbol _libwebsockets_get_peer_addresses referenced in function "public: void thiscall ofxLibwebsockets::Connection::setupAddress(void)" (?setupAddress@Connection@ofxLibwebsockets@@QAEXXZ) 1>Reactor.obj : error LNK2001: unresolved external symbol _libwebsockets_get_peer_addresses 1>Connection.obj : error LNK2019: unresolved external symbol _libwebsocket_get_socket_fd referenced in function "public: void thiscall ofxLibwebsockets::Connection::setupAddress(void)" (?setupAddress@Connection@ofxLibwebsockets@@QAEXXZ) 1>Connection.obj : error LNK2019: unresolved external symbol _libwebsocket_write referenced in function "public: void thiscall ofxLibwebsockets::Connection::send(class std::basic_string<char,struct std::char_traits,class std::allocator > const &)" (?send@Connection@ofxLibwebsockets@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) 1>Connection.obj : error LNK2019: unresolved external symbol _lws_b64_encode_string referenced in function "public: void thiscall ofxLibwebsockets::Connection::sendBinary(unsigned char ,unsigned int)" (?sendBinary@Connection@ofxLibwebsockets@@QAEXPAEI@Z) 1>Connection.obj : error LNK2019: unresolved external symbol _lws_b64_decode_string referenced in function "public: class std::basic_string<char,struct std::char_traits,class std::allocator > const thiscall ofxLibwebsockets::Connection::recv(class std::basic_string<char,struct std::char_traits,class std::allocator > const &)" (?recv@Connection@ofxLibwebsockets@@QAE?BV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV34@@Z) 1>Protocol.obj : error LNK2019: unresolved external symbol _libwebsockets_broadcast referenced in function "public: void thiscall ofxLibwebsockets::Protocol::broadcast(class std::basic_string<char,struct std::char_traits,class std::allocator > const &)" (?broadcast@Protocol@ofxLibwebsockets@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) 1>Reactor.obj : error LNK2019: unresolved external symbol _libwebsockets_serve_http_file referenced in function "public: unsigned int __thiscall ofxLibwebsockets::Reactor::_http(struct libwebsocket ,char const * const)" (?_http@Reactor@ofxLibwebsockets@@QAEIPAUlibwebsocket@@QBD@Z)

robotconscience commented 11 years ago

yes, it looks like the libwebsockets libs aren't being linked in correctly. First, you need to add the ofxLibwebsockets paths to the "Additional Library Directories":

robotconscience commented 11 years ago

Apologies if the example projects are messed up! I'm using ofxLws in a Windows-based install right now, so I'll be updating everything to work much better ASAP!

j3ffgray commented 11 years ago

That did the trick, thanks! The documentation for manually setting linker settings and includes in Visual C++ for openFrameworks is very stark (especially since they are moving towards having people just use the projectGenerator), so this is very helpful in general since I'm usually strictly in Xcode. Thanks a bunch, and thats for a great WebSocket wrapper addon! :)