diff --git a/examples/visual_studio_cpp/libztHelloWorld/libztHelloWorld.sln b/examples/visual_studio_cpp/libztHelloWorld/libztHelloWorld.sln new file mode 100644 index 0000000..25ef287 --- /dev/null +++ b/examples/visual_studio_cpp/libztHelloWorld/libztHelloWorld.sln @@ -0,0 +1,28 @@ + +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/visual_studio_cpp/libztHelloWorld/libztHelloWorld/ReadMe.txt b/examples/visual_studio_cpp/libztHelloWorld/libztHelloWorld/ReadMe.txt new file mode 100644 index 0000000..4e999e1 --- /dev/null +++ b/examples/visual_studio_cpp/libztHelloWorld/libztHelloWorld/ReadMe.txt @@ -0,0 +1,40 @@ +======================================================================== + 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/visual_studio_cpp/libztHelloWorld/libztHelloWorld/libztHelloWorld.cpp b/examples/visual_studio_cpp/libztHelloWorld/libztHelloWorld/libztHelloWorld.cpp new file mode 100644 index 0000000..ee177ea --- /dev/null +++ b/examples/visual_studio_cpp/libztHelloWorld/libztHelloWorld/libztHelloWorld.cpp @@ -0,0 +1,22 @@ +// libztHelloWorld - Simple demo with libzt.lib and libzt.dll + +#include "stdafx.h" +#include +#include +#include +#include + +#include "C:\msys\home\ZeroTier\libzt\include\libzt.h" + +int main() +{ + printf("waiting for libzt to come online...\n"); + zts_simple_start("dlldir", "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/visual_studio_cpp/libztHelloWorld/libztHelloWorld/libztHelloWorld.vcxproj b/examples/visual_studio_cpp/libztHelloWorld/libztHelloWorld/libztHelloWorld.vcxproj new file mode 100644 index 0000000..14c5ba9 --- /dev/null +++ b/examples/visual_studio_cpp/libztHelloWorld/libztHelloWorld/libztHelloWorld.vcxproj @@ -0,0 +1,166 @@ + + + + + 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 + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/visual_studio_cpp/libztHelloWorld/libztHelloWorld/libztHelloWorld.vcxproj.filters b/examples/visual_studio_cpp/libztHelloWorld/libztHelloWorld/libztHelloWorld.vcxproj.filters new file mode 100644 index 0000000..791e98f --- /dev/null +++ b/examples/visual_studio_cpp/libztHelloWorld/libztHelloWorld/libztHelloWorld.vcxproj.filters @@ -0,0 +1,45 @@ + + + + + {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 + + + + + + + + + \ No newline at end of file diff --git a/examples/visual_studio_cpp/libztHelloWorld/libztHelloWorld/stdafx.cpp b/examples/visual_studio_cpp/libztHelloWorld/libztHelloWorld/stdafx.cpp new file mode 100644 index 0000000..b2aa363 --- /dev/null +++ b/examples/visual_studio_cpp/libztHelloWorld/libztHelloWorld/stdafx.cpp @@ -0,0 +1,8 @@ +// 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/visual_studio_cpp/libztHelloWorld/libztHelloWorld/stdafx.h b/examples/visual_studio_cpp/libztHelloWorld/libztHelloWorld/stdafx.h new file mode 100644 index 0000000..b005a83 --- /dev/null +++ b/examples/visual_studio_cpp/libztHelloWorld/libztHelloWorld/stdafx.h @@ -0,0 +1,15 @@ +// 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/visual_studio_cpp/libztHelloWorld/libztHelloWorld/targetver.h b/examples/visual_studio_cpp/libztHelloWorld/libztHelloWorld/targetver.h new file mode 100644 index 0000000..87c0086 --- /dev/null +++ b/examples/visual_studio_cpp/libztHelloWorld/libztHelloWorld/targetver.h @@ -0,0 +1,8 @@ +#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