diff --git a/examples/cpp/ExampleWindowsCppApp/ExampleWindowsCppApp.sln b/examples/cpp/ExampleWindowsCppApp/ExampleWindowsCppApp.sln new file mode 100644 index 0000000..429a747 --- /dev/null +++ b/examples/cpp/ExampleWindowsCppApp/ExampleWindowsCppApp.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27130.2027 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ExampleWindowsCppApp", "ExampleWindowsCppApp\ExampleWindowsCppApp.vcxproj", "{D6BC8888-0498-4BDB-AFAF-21090A39082A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D6BC8888-0498-4BDB-AFAF-21090A39082A}.Debug|x64.ActiveCfg = Debug|x64 + {D6BC8888-0498-4BDB-AFAF-21090A39082A}.Debug|x64.Build.0 = Debug|x64 + {D6BC8888-0498-4BDB-AFAF-21090A39082A}.Debug|x86.ActiveCfg = Debug|Win32 + {D6BC8888-0498-4BDB-AFAF-21090A39082A}.Debug|x86.Build.0 = Debug|Win32 + {D6BC8888-0498-4BDB-AFAF-21090A39082A}.Release|x64.ActiveCfg = Release|x64 + {D6BC8888-0498-4BDB-AFAF-21090A39082A}.Release|x64.Build.0 = Release|x64 + {D6BC8888-0498-4BDB-AFAF-21090A39082A}.Release|x86.ActiveCfg = Release|Win32 + {D6BC8888-0498-4BDB-AFAF-21090A39082A}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {68E97C56-8BB2-44E4-8536-069924BC9707} + EndGlobalSection +EndGlobal diff --git a/examples/cpp/ExampleWindowsCppApp/ExampleWindowsCppApp/ExampleWindowsCppApp.cpp b/examples/cpp/ExampleWindowsCppApp/ExampleWindowsCppApp/ExampleWindowsCppApp.cpp new file mode 100644 index 0000000..dcd37ba Binary files /dev/null and b/examples/cpp/ExampleWindowsCppApp/ExampleWindowsCppApp/ExampleWindowsCppApp.cpp differ diff --git a/examples/cpp/cxproj_dll/libztHelloWorld/libztHelloWorld.vcxproj b/examples/cpp/ExampleWindowsCppApp/ExampleWindowsCppApp/ExampleWindowsCppApp.vcxproj similarity index 69% rename from examples/cpp/cxproj_dll/libztHelloWorld/libztHelloWorld.vcxproj rename to examples/cpp/ExampleWindowsCppApp/ExampleWindowsCppApp/ExampleWindowsCppApp.vcxproj index 0c007b1..5581f98 100644 --- a/examples/cpp/cxproj_dll/libztHelloWorld/libztHelloWorld.vcxproj +++ b/examples/cpp/ExampleWindowsCppApp/ExampleWindowsCppApp/ExampleWindowsCppApp.vcxproj @@ -1,166 +1,174 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - {31A73533-81AA-4885-AF93-796A96540C91} - Win32Proj - libztHelloWorld - 8.1 - - - - Application - true - v140 - Unicode - - - Application - false - v140 - true - Unicode - - - Application - true - v140 - Unicode - - - Application - false - v140 - true - Unicode - - - - - - - - - - - - - - - - - - - - - true - - - true - - - false - - - false - - - - - - Level3 - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - - - Console - true - - - - - - - Level3 - Disabled - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - - - Console - true - C:\msys\home\ZeroTier\libzt;%(AdditionalLibraryDirectories) - - - - - Level3 - - - MaxSpeed - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - - - Console - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - - - Console - true - true - true - - - - - - - - - - - - - - - - - - - - - - - + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 15.0 + {D6BC8888-0498-4BDB-AFAF-21090A39082A} + Win32Proj + ExampleWindowsCppApp + 10.0.16299.0 + + + + Application + true + v141 + Unicode + + + Application + false + v141 + true + Unicode + + + Application + true + v141 + Unicode + + + Application + false + v141 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + true + + + false + + + false + + + + Use + Level3 + Disabled + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + C:\libzt\include;%(AdditionalIncludeDirectories) + + + Console + true + C:\libzt\bin\lib\Debug;%(AdditionalLibraryDirectories) + ws2_32.lib;iphlpapi.lib;Shlwapi.lib;zt-static.lib;%(AdditionalDependencies) + + + + + Use + Level3 + Disabled + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Use + Level3 + MaxSpeed + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + C:\libzt\include;%(AdditionalIncludeDirectories) + + + Console + true + true + true + C:\libzt\bin\lib\Release;%(AdditionalLibraryDirectories) + zt-static.lib;ws2_32.lib;shlwapi.lib;iphlpapi.lib;%(AdditionalDependencies) + + + + + Use + Level3 + MaxSpeed + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + C:\libzt\include;%(AdditionalIncludeDirectories) + + + Console + true + true + true + zt-static.lib;ws2_32.lib;iphlpapi.lib;Shlwapi.lib;%(AdditionalDependencies) + C:\libzt\examples\cpp\ExampleWindowsCppApp\ExampleWindowsCppApp\Debug;%(AdditionalLibraryDirectories) + + + + + + + + + + Create + Create + Create + Create + + + + + \ No newline at end of file diff --git a/examples/cpp/cxproj_dll/libztHelloWorld/libztHelloWorld.vcxproj.filters b/examples/cpp/ExampleWindowsCppApp/ExampleWindowsCppApp/ExampleWindowsCppApp.vcxproj.filters similarity index 73% rename from examples/cpp/cxproj_dll/libztHelloWorld/libztHelloWorld.vcxproj.filters rename to examples/cpp/ExampleWindowsCppApp/ExampleWindowsCppApp/ExampleWindowsCppApp.vcxproj.filters index f3328b4..64d4196 100644 --- a/examples/cpp/cxproj_dll/libztHelloWorld/libztHelloWorld.vcxproj.filters +++ b/examples/cpp/ExampleWindowsCppApp/ExampleWindowsCppApp/ExampleWindowsCppApp.vcxproj.filters @@ -1,45 +1,33 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - - - - Header Files - - - Header Files - - - Header Files - - - - - Source Files - - - Source Files - - - - - - - - + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + \ No newline at end of file diff --git a/examples/cpp/ExampleWindowsCppApp/ExampleWindowsCppApp/stdafx.cpp b/examples/cpp/ExampleWindowsCppApp/ExampleWindowsCppApp/stdafx.cpp new file mode 100644 index 0000000..d090f46 Binary files /dev/null and b/examples/cpp/ExampleWindowsCppApp/ExampleWindowsCppApp/stdafx.cpp differ diff --git a/examples/cpp/ExampleWindowsCppApp/ExampleWindowsCppApp/stdafx.h b/examples/cpp/ExampleWindowsCppApp/ExampleWindowsCppApp/stdafx.h new file mode 100644 index 0000000..94d4ed8 Binary files /dev/null and b/examples/cpp/ExampleWindowsCppApp/ExampleWindowsCppApp/stdafx.h differ diff --git a/examples/cpp/ExampleWindowsCppApp/ExampleWindowsCppApp/targetver.h b/examples/cpp/ExampleWindowsCppApp/ExampleWindowsCppApp/targetver.h new file mode 100644 index 0000000..567cd34 Binary files /dev/null and b/examples/cpp/ExampleWindowsCppApp/ExampleWindowsCppApp/targetver.h differ diff --git a/examples/cpp/cxproj_dll/README.md b/examples/cpp/cxproj_dll/README.md deleted file mode 100644 index 4ea215d..0000000 --- a/examples/cpp/cxproj_dll/README.md +++ /dev/null @@ -1,11 +0,0 @@ -## libzt in C++ via DLL import -*** - - - Add [libzt.dll]() and [libzt.lib]() to solution as existing items. - - Place [libzt.dll](libzt.dll) in the same directory as the executable. - - Include `libzt.h` in application source. - - Access functions grlobally like so: `zts_socket(...)` - -*** - -The Windows `.dll` and `.lib` files are provided pre-built at the above links, but if you'd like build instructions you can check out [BUILDING.md](../../BUILDING.md) \ No newline at end of file diff --git a/examples/cpp/cxproj_dll/libztHelloWorld.sln b/examples/cpp/cxproj_dll/libztHelloWorld.sln deleted file mode 100644 index 25ef287..0000000 --- a/examples/cpp/cxproj_dll/libztHelloWorld.sln +++ /dev/null @@ -1,28 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libztHelloWorld", "libztHelloWorld\libztHelloWorld.vcxproj", "{31A73533-81AA-4885-AF93-796A96540C91}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {31A73533-81AA-4885-AF93-796A96540C91}.Debug|x64.ActiveCfg = Debug|x64 - {31A73533-81AA-4885-AF93-796A96540C91}.Debug|x64.Build.0 = Debug|x64 - {31A73533-81AA-4885-AF93-796A96540C91}.Debug|x86.ActiveCfg = Debug|Win32 - {31A73533-81AA-4885-AF93-796A96540C91}.Debug|x86.Build.0 = Debug|Win32 - {31A73533-81AA-4885-AF93-796A96540C91}.Release|x64.ActiveCfg = Release|x64 - {31A73533-81AA-4885-AF93-796A96540C91}.Release|x64.Build.0 = Release|x64 - {31A73533-81AA-4885-AF93-796A96540C91}.Release|x86.ActiveCfg = Release|Win32 - {31A73533-81AA-4885-AF93-796A96540C91}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/examples/cpp/cxproj_dll/libztHelloWorld/ReadMe.txt b/examples/cpp/cxproj_dll/libztHelloWorld/ReadMe.txt deleted file mode 100644 index 4e999e1..0000000 --- a/examples/cpp/cxproj_dll/libztHelloWorld/ReadMe.txt +++ /dev/null @@ -1,40 +0,0 @@ -======================================================================== - CONSOLE APPLICATION : libztHelloWorld Project Overview -======================================================================== - -AppWizard has created this libztHelloWorld application for you. - -This file contains a summary of what you will find in each of the files that -make up your libztHelloWorld application. - - -libztHelloWorld.vcxproj - This is the main project file for VC++ projects generated using an Application Wizard. - It contains information about the version of Visual C++ that generated the file, and - information about the platforms, configurations, and project features selected with the - Application Wizard. - -libztHelloWorld.vcxproj.filters - This is the filters file for VC++ projects generated using an Application Wizard. - It contains information about the association between the files in your project - and the filters. This association is used in the IDE to show grouping of files with - similar extensions under a specific node (for e.g. ".cpp" files are associated with the - "Source Files" filter). - -libztHelloWorld.cpp - This is the main application source file. - -///////////////////////////////////////////////////////////////////////////// -Other standard files: - -StdAfx.h, StdAfx.cpp - These files are used to build a precompiled header (PCH) file - named libztHelloWorld.pch and a precompiled types file named StdAfx.obj. - -///////////////////////////////////////////////////////////////////////////// -Other notes: - -AppWizard uses "TODO:" comments to indicate parts of the source code you -should add to or customize. - -///////////////////////////////////////////////////////////////////////////// diff --git a/examples/cpp/cxproj_dll/libztHelloWorld/libztHelloWorld.cpp b/examples/cpp/cxproj_dll/libztHelloWorld/libztHelloWorld.cpp deleted file mode 100644 index 82563da..0000000 --- a/examples/cpp/cxproj_dll/libztHelloWorld/libztHelloWorld.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// libztHelloWorld - Simple demo with libzt.lib and libzt.dll - -#include "stdafx.h" -#include -#include -#include -#include - -#include "..\..\..\..\include\libzt.h" - -int main() -{ - printf("waiting for libzt to come online...\n"); - zts_startjoin("config_path", "17d709436c2c5367"); - printf("started. now performing a socket call\n"); - int fd = zts_socket(AF_INET, SOCK_STREAM, 0); - printf("fd=%d\n", fd); - // zts_connect(), zts_bind(), etc... - zts_stop(); - return 0; -} - diff --git a/examples/cpp/cxproj_dll/libztHelloWorld/stdafx.cpp b/examples/cpp/cxproj_dll/libztHelloWorld/stdafx.cpp deleted file mode 100644 index b2aa363..0000000 --- a/examples/cpp/cxproj_dll/libztHelloWorld/stdafx.cpp +++ /dev/null @@ -1,8 +0,0 @@ -// stdafx.cpp : source file that includes just the standard includes -// libztHelloWorld.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information - -#include "stdafx.h" - -// TODO: reference any additional headers you need in STDAFX.H -// and not in this file diff --git a/examples/cpp/cxproj_dll/libztHelloWorld/stdafx.h b/examples/cpp/cxproj_dll/libztHelloWorld/stdafx.h deleted file mode 100644 index b005a83..0000000 --- a/examples/cpp/cxproj_dll/libztHelloWorld/stdafx.h +++ /dev/null @@ -1,15 +0,0 @@ -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, but -// are changed infrequently -// - -#pragma once - -#include "targetver.h" - -#include -#include - - - -// TODO: reference additional headers your program requires here diff --git a/examples/cpp/cxproj_dll/libztHelloWorld/targetver.h b/examples/cpp/cxproj_dll/libztHelloWorld/targetver.h deleted file mode 100644 index 87c0086..0000000 --- a/examples/cpp/cxproj_dll/libztHelloWorld/targetver.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -// Including SDKDDKVer.h defines the highest available Windows platform. - -// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and -// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. - -#include