Modified to build as a library.

Build instructions:

	gmake -f makefile_orig
		or
	make -f makefile_orig 
	g++ -I.. -Lbin -l7za CPP/7zip/UI/Console/p7zipMain.cpp 
	env LD_LIBRARY_PATH=bin a.out

Modifications:

--- C/Ppmd.h	15 Jun 2017 14:14:28 -0000
+++ C/Ppmd.h	15 Dec 2017 15:49:10 -0000
-#pragma pack(push, 1)
-/* Most compilers works OK here even without #pragma pack(push, 1), but some GCC compilers need it. */
-#pragma pack(pop)

--- C/Ppmd8.h	15 Jun 2017 14:14:28 -0000
+++ C/Ppmd8.h	15 Dec 2017 15:49:10 -0000
-#pragma pack(push, 1)
-#pragma pack(pop)

--- CPP/7zip/Archive/Zip/ZipUpdate.cpp	15 Jun 2017 14:14:35 -0000
+++ CPP/7zip/Archive/Zip/ZipUpdate.cpp	15 Dec 2017 15:48:55 -0000
-  DECL_EXTERNAL_CODECS_LOC_VARS2;
+  DECL_EXTERNAL_CODECS_LOC_VARS2

--- CPP/7zip/UI/Common/EnumDirItems.cpp	15 Jun 2017 14:14:47 -0000
+++ CPP/7zip/UI/Common/EnumDirItems.cpp	15 Dec 2017 15:48:12 -0000
-    const NWildcard::ECensorPathMode pathMode,
+    NWildcard::ECensorPathMode pathMode,

--- CPP/7zip/UI/Console/Main.cpp	15 Jun 2017 14:14:48 -0000
+++ CPP/7zip/UI/Console/Main.cpp	15 Dec 2017 15:48:11 -0000
-int Main2(
-  #ifndef _WIN32
-  int numArgs, char *args[]
-  #endif
-)
+int Main2( int numArgs, const char ** args)

--- CPP/7zip/UI/Console/MainAr.cpp	15 Jun 2017 14:14:48 -0000
+++ CPP/7zip/UI/Console/MainAr.cpp	15 Dec 2017 15:48:11 -0000
+
-extern int Main2(
-  #ifndef _WIN32
-  int numArgs, char *args[]
-  #endif
-);
+extern int Main2( int numArgs, const char ** args);
-int MY_CDECL main
-(
-  #ifndef _WIN32
-  int numArgs, char *args[]
-  #endif
-)
+int MY_CDECL eai7zip ( int numArgs, const char ** args)

--- CPP/Windows/ErrorMsg.cpp	15 Jun 2017 14:14:57 -0000
+++ CPP/Windows/ErrorMsg.cpp	15 Dec 2017 15:47:39 -0000
-  switch(errorCode) {
+  switch((HRESULT)errorCode) {

--- CPP/myWindows/myPrivate.h	15 Jun 2017 14:14:59 -0000
+++ CPP/myWindows/myPrivate.h	15 Dec 2017 15:47:36 -0000
-void mySplitCommandLine(int numArguments, char *arguments[],UStringVector &parts);
+void mySplitCommandLine(int numArguments, const char **arguments,UStringVector &parts);

--- CPP/myWindows/mySplitCommandLine.cpp	15 Jun 2017 14:14:59 -0000
+++ CPP/myWindows/mySplitCommandLine.cpp	15 Dec 2017 15:47:36 -0000
-void mySplitCommandLine(int numArguments, char *arguments[],UStringVector &parts) {
+void mySplitCommandLine(int numArguments, const char **arguments,UStringVector &parts) {
+#if 0
-        char * arg = arguments[ind];
+        const char * arg = arguments[ind];
+#endif

