From 0496e4680a960f50903d5780c7f70be193073c28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=A0=91=E6=96=B0?= Date: Tue, 6 Sep 2022 15:20:02 +0800 Subject: [PATCH] compile demos on windows for x64 --- app/gson/gson_vc2019.vcxproj | 2 ++ app/net_tools/net_tools_vc2019.vcxproj | 2 +- .../redis_builder_vc2019.vcxproj | 14 ++++---- .../redis_builder/redis_commands.cpp | 4 +-- app/wizard/wizard_vc2019.vcxproj | 8 ++--- .../dns-gate/service/dns-gate_vc2019.vcxproj | 32 +++++++++---------- app/wizard_demo/httpd_proxy/http_servlet.cpp | 2 +- .../httpd_proxy/httpd_proxy_vc2019.vcxproj | 26 +++++++-------- lib_fiber/samples-c++1x/httpd/main.cpp | 2 +- 9 files changed, 47 insertions(+), 45 deletions(-) diff --git a/app/gson/gson_vc2019.vcxproj b/app/gson/gson_vc2019.vcxproj index 7aa9c9cbc..1bbe8324b 100644 --- a/app/gson/gson_vc2019.vcxproj +++ b/app/gson/gson_vc2019.vcxproj @@ -123,6 +123,8 @@ true true true + $(SolutionDir)lib_acl_cpp\include;$(SolutionDir)lib_acl\include;./include;%(AdditionalIncludeDirectories) + _CRT_SECURE_NO_WARNINGS;_WIN32;_MBCS;%(PreprocessorDefinitions) true diff --git a/app/net_tools/net_tools_vc2019.vcxproj b/app/net_tools/net_tools_vc2019.vcxproj index 0b7999814..b825df538 100644 --- a/app/net_tools/net_tools_vc2019.vcxproj +++ b/app/net_tools/net_tools_vc2019.vcxproj @@ -116,7 +116,7 @@ uxtheme.lib;Iphlpapi.lib;lib_acl.lib;lib_protocol.lib;lib_acl_cpp.lib;%(AdditionalDependencies) - ..\..\lib\win32;..\..\dist\lib\win32;%(AdditionalLibraryDirectories) + $(OutDir);%(AdditionalLibraryDirectories) libc;%(IgnoreSpecificDefaultLibraries) true Windows diff --git a/app/redis_tools/redis_builder/redis_builder_vc2019.vcxproj b/app/redis_tools/redis_builder/redis_builder_vc2019.vcxproj index c2ff8ea8f..b186c5b53 100644 --- a/app/redis_tools/redis_builder/redis_builder_vc2019.vcxproj +++ b/app/redis_tools/redis_builder/redis_builder_vc2019.vcxproj @@ -180,7 +180,7 @@ lib_acl_cpp.lib;lib_acl.lib;lib_protocol.lib;%(AdditionalDependencies) - $(OutDir)redis_builder.exe + $(OutDir)$(TargetName)$(TargetExt) $(OutDir);%(AdditionalLibraryDirectories) true $(OutDir)redis_builder.pdb @@ -199,7 +199,7 @@ lib_acl_cpp.lib;lib_acl.lib;lib_protocol.lib;%(AdditionalDependencies) - $(OutDir)redis_builder.exe + $(OutDir)$(TargetName)$(TargetExt) $(OutDir);%(AdditionalLibraryDirectories) true Console @@ -219,7 +219,7 @@ lib_acl_cpp.lib;lib_acl.lib;lib_protocol.lib;%(AdditionalDependencies) - $(OutDir)redis_builder.exe + $(OutDir)$(TargetName)$(TargetExt) $(OutDir);%(AdditionalLibraryDirectories) true Console @@ -238,7 +238,7 @@ lib_acl_cpp.lib;lib_acl.lib;lib_protocol.lib;%(AdditionalDependencies) - $(OutDir)redis_builder.exe + $(OutDir)$(TargetName)$(TargetExt) $(OutDir);%(AdditionalLibraryDirectories) true Console @@ -263,7 +263,7 @@ copy ..\..\..\dist\lib\win32\lib_protocol.dll $(OutDir) /Y lib_acl_cpp.lib;lib_acl.lib;lib_protocol.lib;%(AdditionalDependencies) - $(OutDir)redis_builder.exe + $(OutDir)$(TargetName)$(TargetExt) $(OutDir);%(AdditionalLibraryDirectories) true Console @@ -290,7 +290,7 @@ copy ..\..\..\dist\lib\win32\lib_protocol.dll $(OutDir) /Y lib_acl_cpp.lib;lib_acl.lib;lib_protocol.lib;%(AdditionalDependencies) - $(OutDir)redis_builder.exe + $(OutDir)$(TargetName)$(TargetExt) $(OutDir);%(AdditionalLibraryDirectories) true $(OutDir)redis_builder.pdb @@ -316,7 +316,7 @@ copy ..\..\..\dist\lib\win32\lib_protocol_d.dll $(OutDir) /Y lib_acl_cpp.lib;lib_acl.lib;lib_protocol.lib;%(AdditionalDependencies) - $(OutDir)redis_builder.exe + $(OutDir)$(TargetName)$(TargetExt) $(OutDir);%(AdditionalLibraryDirectories) true $(OutDir)redis_builder.pdb diff --git a/app/redis_tools/redis_builder/redis_commands.cpp b/app/redis_tools/redis_builder/redis_commands.cpp index 57865401a..e2dd518b7 100644 --- a/app/redis_tools/redis_builder/redis_commands.cpp +++ b/app/redis_tools/redis_builder/redis_commands.cpp @@ -618,7 +618,7 @@ int redis_commands::scan(const char* addr, const char* pattern, } i++; - n += res.size(); + n += (int) res.size(); if (display_count > 0 && n1++ < display_count) { size_t n2 = 0; @@ -628,7 +628,7 @@ int redis_commands::scan(const char* addr, const char* pattern, if (display_count > 0 && n2 >= display_count) { break; } - get((*cit).c_str(), display_count); + get((*cit).c_str(), (int) display_count); n2++; } } diff --git a/app/wizard/wizard_vc2019.vcxproj b/app/wizard/wizard_vc2019.vcxproj index 5f6bc2bef..223111cc9 100644 --- a/app/wizard/wizard_vc2019.vcxproj +++ b/app/wizard/wizard_vc2019.vcxproj @@ -71,7 +71,7 @@ true - $(SolutionDir)$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ @@ -81,7 +81,7 @@ false - $(SolutionDir)$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Platform)\$(Configuration)\ @@ -136,7 +136,7 @@ ..\..\lib_acl\include;..\..\lib_protocol\include;..\..\lib_acl_cpp\include; - $(OutDir)wizard.exe + $(OutDir)$(TargetName)$(TargetExt) true Console true @@ -156,7 +156,7 @@ ..\..\lib_acl\include;..\..\lib_protocol\include;..\..\lib_acl_cpp\include; - $(OutDir)wizard.exe + $(OutDir)$(TargetName)$(TargetExt) true Console true diff --git a/app/wizard_demo/dns-gate/service/dns-gate_vc2019.vcxproj b/app/wizard_demo/dns-gate/service/dns-gate_vc2019.vcxproj index 4555b2582..f503df1ae 100644 --- a/app/wizard_demo/dns-gate/service/dns-gate_vc2019.vcxproj +++ b/app/wizard_demo/dns-gate/service/dns-gate_vc2019.vcxproj @@ -119,8 +119,8 @@ true - .\ - Debug\ + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Configuration)\ $(SolutionDir)$(Configuration)\ @@ -129,8 +129,8 @@ false - .\ - Release\ + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Configuration)\ .\ @@ -139,8 +139,8 @@ false - .\ - ReleaseDll\ + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Configuration)\ .\ @@ -149,8 +149,8 @@ true - .\ - DebugDll\ + $(SolutionDir)$(Platform)\$(Configuration)\ + $(Configuration)\ @@ -178,7 +178,7 @@ Disabled - ..\..\..\lib_acl_cpp\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + ..\..\..\..\lib_acl_cpp\include;..\..\..\..\lib_acl\include;..\..\..\..\lib_fiber\cpp\include;.;%(AdditionalIncludeDirectories) WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL @@ -188,7 +188,7 @@ lib_acl_cpp.lib;lib_acl.lib;lib_protocol.lib;libfiber.lib;libfiber_cpp.lib;%(AdditionalDependencies) - $(OutDir)dns-gate.exe + $(OutDir)$(TargetName)$(TargetExt) $(OutDir);%(AdditionalLibraryDirectories) true $(OutDir)dns-gate.pdb @@ -222,7 +222,7 @@ - ..\..\..\lib_acl_cpp\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + ..\..\..\..\lib_acl_cpp\include;..\..\..\..\lib_acl\include;..\..\..\..\lib_fiber\cpp\include;.;%(AdditionalIncludeDirectories) WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) MultiThreadedDLL Use @@ -231,7 +231,7 @@ lib_acl_cpp.lib;lib_acl.lib;lib_protocol.lib;libfiber.lib;libfiber_cpp.lib;%(AdditionalDependencies) - $(OutDir)dns-gate.exe + $(OutDir)$(TargetName)$(TargetExt) $(OutDir);%(AdditionalLibraryDirectories) true Console @@ -266,7 +266,7 @@ copy ..\..\..\dist\lib\win32\lib_protocol.dll $(OutDir) /Y - ..\..\..\lib_acl_cpp\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + ..\..\..\..\lib_acl_cpp\include;..\..\..\..\lib_acl\include;..\..\..\..\lib_fiber\cpp\include;.;%(AdditionalIncludeDirectories) WIN64;NDEBUG;_CONSOLE;ACL_CPP_DLL;%(PreprocessorDefinitions) MultiThreadedDLL Use @@ -275,7 +275,7 @@ copy ..\..\..\dist\lib\win32\lib_protocol.dll $(OutDir) /Y lib_acl_cpp.lib;lib_acl.lib;lib_protocol.lib;libfiber.lib;libfiber_cpp.lib;%(AdditionalDependencies) - $(OutDir)dns-gate.exe + $(OutDir)$(TargetName)$(TargetExt) $(OutDir);%(AdditionalLibraryDirectories) true Console @@ -318,7 +318,7 @@ copy ..\..\..\dist\lib\win32\lib_protocol_d.dll $(OutDir) /Y Disabled - ..\..\..\lib_acl_cpp\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + ..\..\..\..\lib_acl_cpp\include;..\..\..\..\lib_acl\include;..\..\..\..\lib_fiber\cpp\include;.;%(AdditionalIncludeDirectories) WIN64;_DEBUG;_CONSOLE;ACL_CPP_DLL;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL @@ -328,7 +328,7 @@ copy ..\..\..\dist\lib\win32\lib_protocol_d.dll $(OutDir) /Y lib_acl_cpp.lib;lib_acl.lib;lib_protocol.lib;libfiber.lib;libfiber_cpp.lib;%(AdditionalDependencies) - $(OutDir)dns-gate.exe + $(OutDir)$(TargetName)$(TargetExt) $(OutDir);%(AdditionalLibraryDirectories) true $(OutDir)dns-gate.pdb diff --git a/app/wizard_demo/httpd_proxy/http_servlet.cpp b/app/wizard_demo/httpd_proxy/http_servlet.cpp index 24daf48c6..0764a6b32 100644 --- a/app/wizard_demo/httpd_proxy/http_servlet.cpp +++ b/app/wizard_demo/httpd_proxy/http_servlet.cpp @@ -153,7 +153,7 @@ bool http_servlet::doConnect(request_t& req, response_t&) delete peer; return false; } - printf("connect %s ok, fd=%d\r\n", host.c_str(), peer->sock_handle()); + printf("connect %s ok, fd=%d\r\n", host.c_str(), (int) peer->sock_handle()); #define USE_REFER diff --git a/app/wizard_demo/httpd_proxy/httpd_proxy_vc2019.vcxproj b/app/wizard_demo/httpd_proxy/httpd_proxy_vc2019.vcxproj index b6cf20708..a362b2c5d 100644 --- a/app/wizard_demo/httpd_proxy/httpd_proxy_vc2019.vcxproj +++ b/app/wizard_demo/httpd_proxy/httpd_proxy_vc2019.vcxproj @@ -119,7 +119,7 @@ true - $(SolutionDir)$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Configuration)\ @@ -129,7 +129,7 @@ false - $(SolutionDir)$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Configuration)\ @@ -139,7 +139,7 @@ false - $(SolutionDir)$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Configuration)\ @@ -149,7 +149,7 @@ true - $(SolutionDir)$(Configuration)\ + $(SolutionDir)$(Platform)\$(Configuration)\ $(Configuration)\ @@ -166,7 +166,7 @@ lib_acl_cpp.lib;lib_acl.lib;lib_protocol.lib;libfiber.lib;libfiber_cpp.lib;%(AdditionalDependencies) - $(OutDir)httpd_proxy.exe + $(OutDir)$(TargetName)$(TargetExt) $(OutDir);%(AdditionalLibraryDirectories) true $(OutDir)httpd_proxy.pdb @@ -188,7 +188,7 @@ lib_acl_cpp.lib;lib_acl.lib;lib_protocol.lib;libfiber.lib;libfiber_cpp.lib;%(AdditionalDependencies) - $(OutDir)httpd_proxy.exe + $(OutDir)$(TargetName)$(TargetExt) $(OutDir);%(AdditionalLibraryDirectories) true $(OutDir)httpd_proxy.pdb @@ -208,7 +208,7 @@ lib_acl_cpp.lib;lib_acl.lib;lib_protocol.lib;libfiber.lib;libfiber_cpp.lib;%(AdditionalDependencies) - $(OutDir)httpd_proxy.exe + $(OutDir)$(TargetName)$(TargetExt) $(OutDir);%(AdditionalLibraryDirectories) true Console @@ -219,7 +219,7 @@ - ..\..\..\lib_acl_cpp\include;..\..\..\lib_acl\include;%(AdditionalIncludeDirectories) + ..\..\..\lib_acl_cpp\include;..\..\..\lib_acl\include;..\..\..\lib_fiber\c\include;..\..\..\lib_fiber\cpp\include;..\..\..\lib_protocol\include;%(AdditionalIncludeDirectories) WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) MultiThreadedDLL Use @@ -228,7 +228,7 @@ lib_acl_cpp.lib;lib_acl.lib;lib_protocol.lib;libfiber.lib;libfiber_cpp.lib;%(AdditionalDependencies) - $(OutDir)httpd_proxy.exe + $(OutDir)$(TargetName)$(TargetExt) $(OutDir);%(AdditionalLibraryDirectories) true Console @@ -247,7 +247,7 @@ lib_acl_cpp.lib;lib_acl.lib;lib_protocol.lib;libfiber.lib;libfiber_cpp.lib;%(AdditionalDependencies) - $(OutDir)httpd_proxy.exe + $(OutDir)$(TargetName)$(TargetExt) $(OutDir);%(AdditionalLibraryDirectories) true Console @@ -273,7 +273,7 @@ copy ..\..\..\dist\lib\win32\lib_protocol.dll $(OutDir) /Y lib_acl_cpp.lib;lib_acl.lib;lib_protocol.lib;libfiber.lib;libfiber_cpp.lib;%(AdditionalDependencies) - $(OutDir)httpd_proxy.exe + $(OutDir)$(TargetName)$(TargetExt) $(OutDir);%(AdditionalLibraryDirectories) true Console @@ -300,7 +300,7 @@ copy ..\..\..\dist\lib\win64\lib_protocol.dll $(OutDir) /Y lib_acl_cpp.lib;lib_acl.lib;lib_protocol.lib;libfiber.lib;libfiber_cpp.lib;%(AdditionalDependencies) - $(OutDir)httpd_proxy.exe + $(OutDir)$(TargetName)$(TargetExt) $(OutDir);%(AdditionalLibraryDirectories) true $(OutDir)httpd_proxy.pdb @@ -326,7 +326,7 @@ copy ..\..\..\dist\lib\win32\lib_protocol_d.dll $(OutDir) /Y lib_acl_cpp.lib;lib_acl.lib;lib_protocol.lib;libfiber.lib;libfiber_cpp.lib;%(AdditionalDependencies) - $(OutDir)httpd_proxy.exe + $(OutDir)$(TargetName)$(TargetExt) $(OutDir);%(AdditionalLibraryDirectories) true $(OutDir)httpd_proxy.pdb diff --git a/lib_fiber/samples-c++1x/httpd/main.cpp b/lib_fiber/samples-c++1x/httpd/main.cpp index 92c24a563..dc542e782 100644 --- a/lib_fiber/samples-c++1x/httpd/main.cpp +++ b/lib_fiber/samples-c++1x/httpd/main.cpp @@ -66,7 +66,7 @@ int main(int argc, char *argv[]) { printf("---> thread-%lu on init\r\n", acl::thread::self()); }).on_thread_accept([] (acl::socket_stream& conn) { printf("---> thread-%lu on accept %d\r\n", - acl::thread::self(), conn.sock_handle()); + acl::thread::self(), (int) conn.sock_handle()); return true; });