README 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. This is the README file for the POCO C++ Libraries.
  2. In this document you will find a brief description of the directory layout,
  3. as well as a description necessary steps to build the POCO C++ Libraries.
  4. The Foundation library contains a platform abstraction layer (including classes
  5. for multithreading, file system access, logging, etc.), as well as
  6. a large number of useful utility classes, such various stream buffer and stream
  7. classes, URI handling, and many more.
  8. The XML library contains an XML parser with SAX2 and DOM interfaces,
  9. as well as an XMLWriter.
  10. The Util library contains classes for working with configuration files and
  11. command line arguments, as well as various utility classes.
  12. The Net library contains network classes (sockets, HTTP client/server, etc.).
  13. All libraries come with a test suite and a number of sample programs.
  14. The basic directory layout is as follows:
  15. build/ the build system for Unix and additional utility scripts
  16. config/ build configurations for various Unix platforms
  17. rules/ common build rules for all platforms
  18. scripts/ build and utility scripts
  19. vxconfig/ VxWorks build configurations
  20. cmake/ Support files for CMake
  21. bin/ all executables (dynamic link libraries on Windows)
  22. bin64/ all 64-bit executables (and DLLs)
  23. doc/ additional documentation
  24. lib/ all libraries (import libraries on Windows)
  25. lib64/ all 64-bit libraries
  26. CppUnit/ project and make/build files for the CppUnit unit testing framework
  27. doc/ additional documentation
  28. include/
  29. CppUnit/ header files for CppUnit
  30. src/ source files for CppUnit
  31. WinTestRunner/ Windows GUI for CppUnit
  32. Foundation/ project and make/build files for the Foundation library
  33. include/
  34. Poco/ header files for the Foundation library
  35. src/ source files for the Foundation library
  36. testsuite/ project and make/build files for the Foundation testsuite
  37. src/ source files for the Foundation testsuite
  38. bin/ test suite executables
  39. samples/ sample applications for the Foundation library
  40. XML/ project and make/build files for the XML library
  41. include/
  42. Poco/
  43. XML/ header files for the core XML library
  44. SAX/ header files for SAX support
  45. DOM/ header files for DOM support
  46. src/ source files for the XML library
  47. testsuite/ project and make/build files for the XML testsuite
  48. src/ source files for the XML testsuite
  49. bin/ test suite executables
  50. samples/ sample applications for the XML library
  51. Net/ project and make/build files for the Net library
  52. include/
  53. Poco/
  54. Net/ header files for the Net library
  55. src/ source files for the Net library
  56. testsuite/ project and make/build files for the Net testsuite
  57. src/ source files for the Net testsuite
  58. bin/ test suite executables
  59. samples/ sample applications for the Net library
  60. Depending on what package you have downloaded, there may be other libraries
  61. as well (such as Data, Crypto, NetSSL_OpenSSL and Zip).
  62. DOCUMENTATION
  63. =============
  64. Plenty of documentation (tutorial slides, articles and SDK reference)
  65. is available at <http://pocoproject.org/documentation/>.
  66. EXTERNAL DEPENDENCIES
  67. =====================
  68. The following libraries require third-party software (header files and
  69. libraries) being installed to build properly:
  70. - NetSSL_OpenSSL and Crypt require OpenSSL.
  71. - Data/ODBC requires ODBC
  72. (Microsoft ODBC on Windows, unixODBC or iODBC on Unix/Linux)
  73. - Data/MySQL requires the MySQL client.
  74. Most Unix/Linux systems already have OpenSSL preinstalled. If your system
  75. does not have OpenSSL, please get it from http://www.openssl.org or
  76. another source. You do not have to build OpenSSL yourself - a binary
  77. distribution is fine (e.g., apt-get install openssl libssl-dev).
  78. On macOS, install OpenSSL via Homebrew (brew install openssl).
  79. The easiest way to install OpenSSL on Windows is to get the pre-built
  80. libraries from the pocoproject/openssl Git repository at
  81. <https://github.com/pocoproject/openssl>. This repository is included
  82. as a submodule in the poco GitHub repository, but not in the release
  83. source code packages. You can also provide your own OpenSSL build by
  84. editing the Visual Studio project files.
  85. Depending on where you have installed the OpenSSL libraries,
  86. you might have to edit the build script (buildwin.cmd), or add the
  87. necessary paths to the INCLUDE and LIB environment variables.
  88. Through the Poco/Crypto/Crypto.h and Poco/Net/NetSSL.h header files,
  89. Visual C++ will automatically link the libcrypto.lib and libssl.lib
  90. libraries. If your OpenSSL libraries are named differently, compile
  91. with the macro POCO_EXTERNAL_OPENSSL defined and edit the project
  92. files accordingly.
  93. The Data library requires ODBC support on your system if you want
  94. to build the ODBC connector (which is the default). On Windows
  95. platforms, ODBC should be readily available if you have the
  96. Windows SDK. On Unix/Linux platforms, you can use iODBC
  97. (preinstalled on macOS X) or unixODBC. For the MySQL connector,
  98. the MySQL client libraries and header files are required.
  99. The Data/ODBC and Data/MySQL Makefiles will search for the ODBC
  100. and MySQL headers and libraries in various places. Nevertheless,
  101. the Makefiles may not be able to find the headers and libraries.
  102. In this case, please edit the Makefile in Data/ODBC and/or Data/MySQL
  103. accordingly.
  104. BUILDING WITH CMAKE
  105. ===================
  106. The POCO C++ Libraries support CMake as a build system on Linux, macOS and Windows.
  107. To build the POCO C++ Libraries with CMake:
  108. 1. create a cmake-build directory (e.g. in the POCO root directory):
  109. $ mkdir cmake-build
  110. 2. and run CMake from there:
  111. $ cd cmake-build
  112. $ cmake ..
  113. $ make -s -j (or build the generated Visual Studio solution on Windows)
  114. If you cannot or do not want to build with CMake, there are other options,
  115. described in the following.
  116. BUILDING ON WINDOWS
  117. ===================
  118. Microsoft Visual Studio 2008 or newer is required to build the POCO C++ Libraries on
  119. Windows platforms. Solution and project files for all versions from 2008 to 2017 are included.
  120. 64-bit (x64) builds are supported as well.
  121. You can either build from within Visual Studio (Build->Batch Build->Select All;Rebuild)
  122. or from the command line. To build from the command line, start the
  123. Visual Studio Command Prompt and cd to the directory where you
  124. have extracted the POCO C++ Libraries sources. Then, simply start the buildwin.cmd script
  125. and pass as argument the version of visual studio (90, 100, 110, etc.). You can customize
  126. what is being built by buildwin.cmd by passing appropriate command line arguments to
  127. it. Call buildwin.cmd without arguments to see what is available.
  128. To disable certain components (e.g., NetSSL_OpenSSL or Data/MySQL) from the build,
  129. edit the file named "components" and remove the respective lines.
  130. Certain libraries, like NetSSL_OpenSSL, Crypto or Data/MySQL have dependencies
  131. to other libraries. Since the build script does not know where to find the necessary
  132. header files and import libraries, you have to either add the header file paths to
  133. the INCLUDE environment variable and the library path to the LIB environment variable,
  134. or you'll have to edit the buildwin.cmd script, where these environment variables can
  135. be set as well.
  136. In order to run the test suite and the samples, the top-most bin directory containing
  137. the shared libraries must be in the PATH environment variable.
  138. IMPORTANT NOTE: Please make sure that the path to the directory containing the
  139. POCO C++ Libraries source tree does not contain spaces. Otherwise, the Microsoft
  140. message compiler may fail when building the Foundation library.
  141. BUILDING FOR WINDOWS CE
  142. Building for Windows CE 6.0 and Windows Embedded Compact 2013 is supported with
  143. Microsoft Visual Studio 2008 (CE 6.0), and Visual Studio 2012/2013 (WEC 2013), respectively.
  144. For CE 6.0, unless you have the Digi JumpStart Windows CE 6.0 SDK installed, you'll
  145. have to modify the included Visual Studio project and solution files. Same applies
  146. to the WEC2013 projects, which are based on the AM335X SDK.
  147. Please see the SDK Reference Documentation (http://pocoproject.org/documentation)
  148. for instructions.
  149. BUILDING ON UNIX/LINUX/macOS
  150. ============================
  151. For building on Unix platforms, the POCO C++ Libraries come with their own
  152. build system. The build system is based on GNU Make 3.80 (or newer), with the help
  153. from a few shell scripts. If you do not have GNU Make 3.80 (or later) installed on
  154. your machine, you will need to download it from
  155. http://directory.fsf.org/devel/build/make.html>,
  156. build and install it prior to building the POCO C++ Libraries.
  157. You can check the version of GNU Make installed on your system with
  158. > gmake --version
  159. or
  160. > make --version
  161. Once you have GNU Make up and running, the rest is quite simple.
  162. To extract the sources and build all libraries, testsuites and samples, simply
  163. > gunzip poco-X.Y.tar.gz
  164. > tar -xf poco-X.Y.tar
  165. > cd poco-X.Y
  166. > ./configure
  167. > gmake -s
  168. See the configure script source for a list of possible options.
  169. For starters, we recommend --no-tests and --no-samples, to reduce build times.
  170. On a multicore or multiprocessor machine, use parallel makes to speed up
  171. the build (make -j4).
  172. Once you have successfully built POCO, you can install it
  173. to /usr/local (or another directory specified as parameter
  174. to configure --prefix=<path>):
  175. > sudo gmake -s install
  176. You can omit certain components from the build. For example, you might
  177. want to omit Data/ODBC or Data/MySQL if you do not have the corresponding
  178. third-party libraries (iodbc or unixodbc, mysqlclient) installed
  179. on your system. To do this, use the --omit argument to configure:
  180. > ./configure --omit=Data/ODBC,Data/MySQL
  181. IMPORTANT: Make sure that the path to the build directory does not
  182. contain symbolic links. Furthermore, on macOS (or other systems
  183. with case insensitive filesystems), make sure that the characters in
  184. the path have the correct case. Otherwise you'll get an error saying
  185. "Current working directory not under $PROJECT_BASE.".
  186. BUILDING ON QNX NEUTRINO
  187. ========================
  188. For QNX Neutrino, the Unix build system (see the instructions above) is used.
  189. You can use the build system to cross-compile for a target platform on a Solaris or
  190. Linux host. Unfortunately, the Cygwin-based Windows host environment has some major
  191. quirks that prevent the build system from working there. You can also use the
  192. build system on a self-hosted QNX system. The default build configuration for QNX
  193. (found in build/config/QNX) is for a self-hosted x86 platform. To specify another
  194. target, edit the CCVER setting in the build configuration file. For example, to
  195. compile for a PowerPC target, specify CCVER=3.3.1,gcc_ntoppcbe.
  196. Service Pack 1 for QNX Neutrino 6.3 must be installed, otherwise compiling the
  197. Foundation library will fail due to a problem with the <list> header in the
  198. default (Dinkumware) C++ standard library.
  199. When building on QNX, you might want to disable NetSSL_OpenSSL, Crypto and
  200. some Data connectors, unless you have the necessary third party components
  201. available:
  202. > ./configure --omit=NetSSL_OpenSSL,Crypto,Data/ODBC,Data/MySQL
  203. BUILDING FOR VXWORKS
  204. ====================
  205. Please see the VxWorks Platform Notes in the Reference Documentation for
  206. more information. The Reference Documentation can be found online
  207. at <http://pocoproject.org/docs/>.
  208. MORE INFORMATION
  209. ================
  210. For more information, see the POCO C++ Libraries website
  211. at <http://pocoproject.org>.