{"action":"created","issue":{"url":"https://api.github.com/repos/warmcat/libwebsockets/issues/526","repository_url":"https://api.github.com/repos/warmcat/libwebsockets","labels_url":"https://api.github.com/repos/warmcat/libwebsockets/issues/526/labels{/name}","comments_url":"https://api.github.com/repos/warmcat/libwebsockets/issues/526/comments","events_url":"https://api.github.com/repos/warmcat/libwebsockets/issues/526/events","html_url":"https://github.com/warmcat/libwebsockets/issues/526","id":154510040,"number":526,"title":"[Win10][VS2010/2015][v2.0] Compilation issues","user":{"login":"alexgille","id":1503583,"avatar_url":"https://avatars.githubusercontent.com/u/1503583?v=3","gravatar_id":"","url":"https://api.github.com/users/alexgille","html_url":"https://github.com/alexgille","followers_url":"https://api.github.com/users/alexgille/followers","following_url":"https://api.github.com/users/alexgille/following{/other_user}","gists_url":"https://api.github.com/users/alexgille/gists{/gist_id}","starred_url":"https://api.github.com/users/alexgille/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexgille/subscriptions","organizations_url":"https://api.github.com/users/alexgille/orgs","repos_url":"https://api.github.com/users/alexgille/repos","events_url":"https://api.github.com/users/alexgille/events{/privacy}","received_events_url":"https://api.github.com/users/alexgille/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-05-12T15:21:06Z","updated_at":"2016-05-13T00:51:27Z","closed_at":"2016-05-13T00:26:07Z","body":"I tried to compile **libwebsockets-2.0-stable** with both _Visual Studio 2010 Express_ and _Visual Studio 2015 Express_ but I had some issues with the compilation that fails for few projects in the generated solution.\r\nI'm compiling on Windows 10.\r\n\r\nFirst of all, my cmake command to generate the solution :\r\n\r\n> cmake\t-G \"Visual Studio 10\"\r\n>     -DOPENSSL_ROOT_DIR=C:\\tools\\build_openssl-1.0.2h\r\n>     -DOPENSSL_INCLUDE_DIR=C:\\tools\\build_openssl-1.0.2h\\include\r\n> \t\t\t\t-DOPENSSL_LIBRARIES=C:\\tools\\build_openssl-1.0.2h\\lib\\libeay32.lib;C:\\tools\\build_openssl-1.0.2h\\lib\\ssleay32.lib\r\n> \t\t\t\t-DLWS_WITH_LWSWS=ON\r\n> \t\t\t\t-DLIBUV_INCLUDE_DIRS=C:\\tools\\build_libuv-v1.8.0\\include\r\n> \t\t\t\t-DLIBUV_LIBRARIES=C:\\tools\\build_libuv-v1.8.0\\libuv.lib\r\n> \t\t\t\t-DCMAKE_INSTALL_PREFIX=C:\\tools\\build_libwebsockets-2.0-stable\r\n> \t\t\t\t..\r\n\r\nI made a list of issues I encountered with a set of quick solutions that resolved these issues.\r\n**I don't know if these solutions are good, best, nor accurate** :\r\n\r\n```\r\n*\tError\t:\t\"error C2133: 'protocols' unknown size\" in 'protocol_lws_server_status.c' (line 42)\r\n\tSolution:\tSpecify 'protocols' array size in \"static const struct lws_protocols protocols[];\"\r\n\t\r\n\t\r\n*\tError\t:\t\"warning C4013: 'gettimeofday' undefined; assuming extern returning int\" in 'protocol_lws_status.c' (line 134)\r\n\tSolution:\tAdd 'gettimeofday.c' as external dependency to 'protocol_lws_status' project\r\n\t\t\t\tAdd \"#include <gettimeofday.h>\" at start of 'protocol_lws_status.c' file\t\r\n\t\r\n\t\r\n*\tError\t:\t[VS2010 ONLY] \"unresolved symbol '__func__'\" in 'protocol_lws_mirror.c' (line 58 & 72) and in 'protocol_lws_server_status.c' (line 72)\r\n\tSolution:\tReplace '__func__' by '__FUNCTION__' manually\r\n\t\t\t\t        OR\r\n\t\t\t\tAdd '#include \"../lib/private-libwebsockets.h\"' at start of :\r\n\t\t\t\t\t- protocol_lws_status.c\r\n\t\t\t\t\t- protocol_lws_server_status.c\r\n\t\t\t\t\t- protocol_lws_mirror.c\r\n\r\n\r\n*\tError\t:\t\"fatal error C1083: unable to find 'syslog.h'\" in 'test-server-v2.0.c' (line 23)\r\n\tSolution:\tComment or delete '#include <syslog.h>' preprocessor line\r\n\r\n\r\n*\tError\t:\t\"unresolved external symbol _XXX [...]\" where XXX is a function from this list (in libwebsockets.h) :\r\n\t\t\t\t\t- lws_protocol_vh_priv_zalloc\r\n\t\t\t\t\t- lws_protocol_vh_priv_get\r\n\t\t\t\t\t- lws_vhost_get\r\n\t\t\t\t\t- lws_protocol_get\r\n\t\t\t\t\t- lws_callback_on_writable_all_protocol_vhost\r\n\t\t\t\t\t- lws_extension_callback_pm_deflate\r\n\t\t\t\t\t- lws_create_vhost\r\n\t\t\t\t\t- lws_libuv_stop\r\n\tSolution:\tAdd LWS_EXTERN keyword to each function declaration\r\n\t\t\t\tReplace 'extern' keyword by 'LWS_EXTERN' for function \"lws_extension_callback_pm_deflate\"\r\n\r\n\r\n*\tError\t:\t\"error C2059: syntax error : '}'\" in 'lwsws\\main.c' (line 65).\r\n\tSolution:\tSpecify NULL initialization. Replace '{ }' by '{ NULL, NULL, 0, 0 }'\r\n\r\n\r\n*\tError\t:\t\"error C2036: 'void *': size unknown\" in 'lwsws\\http.c' (line 152)\r\n\tSolution:\tAdd explicit cast '(TCHAR *)' before variable 'in' in 'strcmp()' call\r\n```\r\n\r\nAfter that, everything is fine with compilation and linking. I have all the libs I needed, but some testing executables are still crashing when trying to use them.\r\n\r\nI hope it could help.\r\n\r\nRegards"},"comment":{"url":"https://api.github.com/repos/warmcat/libwebsockets/issues/comments/218925704","html_url":"https://github.com/warmcat/libwebsockets/issues/526#issuecomment-218925704","issue_url":"https://api.github.com/repos/warmcat/libwebsockets/issues/526","id":218925704,"user":{"login":"lws-team","id":15154525,"avatar_url":"https://avatars.githubusercontent.com/u/15154525?v=3","gravatar_id":"","url":"https://api.github.com/users/lws-team","html_url":"https://github.com/lws-team","followers_url":"https://api.github.com/users/lws-team/followers","following_url":"https://api.github.com/users/lws-team/following{/other_user}","gists_url":"https://api.github.com/users/lws-team/gists{/gist_id}","starred_url":"https://api.github.com/users/lws-team/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lws-team/subscriptions","organizations_url":"https://api.github.com/users/lws-team/orgs","repos_url":"https://api.github.com/users/lws-team/repos","events_url":"https://api.github.com/users/lws-team/events{/privacy}","received_events_url":"https://api.github.com/users/lws-team/received_events","type":"User","site_admin":false},"created_at":"2016-05-13T00:51:27Z","updated_at":"2016-05-13T00:51:27Z","body":"https://github.com/libuv/libuv/issues/871"}}