README 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  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/ 64-bit executables (and DLLs) on Windows
  23. doc/ additional documentation
  24. lib/ all libraries (import libraries on Windows)
  25. lib64/ 64-bit libraries on Windows
  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 <https://docs.pocoproject.org/>.
  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, Crypto and JWT require OpenSSL.
  71. - Data/ODBC requires ODBC
  72. (Microsoft ODBC on Windows, unixODBC or iODBC on Unix/Linux)
  73. - Data/MySQL requires the MySQL or MariaDB client library.
  74. - Data/PostgreSQL requires the PostgreSQL client library (libpq).
  75. Most Unix/Linux systems already have OpenSSL preinstalled. If your system
  76. does not have OpenSSL, please get it from https://www.openssl.org or
  77. another source. You do not have to build OpenSSL yourself - a binary
  78. distribution is fine (e.g., apt-get install openssl libssl-dev).
  79. On macOS, install OpenSSL via Homebrew (brew install openssl).
  80. On Windows, OpenSSL can be installed with vcpkg.
  81. The easiest way to install OpenSSL on Windows is to get the pre-built
  82. libraries from the pocoproject/openssl Git repository at
  83. <https://github.com/pocoproject/openssl>. This repository is included
  84. as a submodule in the poco GitHub repository, but not in the release
  85. source code packages. You can also provide your own OpenSSL build by
  86. editing the Visual Studio project files.
  87. Depending on where you have installed the OpenSSL libraries,
  88. you might have to edit the build script (buildwin.cmd), or add the
  89. necessary paths to the INCLUDE and LIB environment variables.
  90. The Data library requires ODBC support on your system if you want
  91. to build the ODBC connector (which is the default). On Windows
  92. platforms, ODBC should be readily available if you have the
  93. Windows SDK. On Unix/Linux platforms, you can use iODBC
  94. (preinstalled on macOS X) or unixODBC. For the MySQL connector,
  95. the MySQL client libraries and header files are required.
  96. The Data/ODBC and Data/MySQL Makefiles will search for the ODBC
  97. and MySQL headers and libraries in various places. Nevertheless,
  98. the Makefiles may not be able to find the headers and libraries.
  99. In this case, please edit the Makefile in Data/ODBC and/or Data/MySQL
  100. accordingly.
  101. BUILDING WITH CMAKE
  102. ===================
  103. The POCO C++ Libraries support CMake as a build system on Linux, macOS and Windows.
  104. To build the POCO C++ Libraries with CMake:
  105. 1. create a cmake-build directory (e.g. in the POCO root directory):
  106. $ mkdir cmake-build
  107. 2. and run CMake from there:
  108. $ cd cmake-build
  109. $ cmake ..
  110. $ make -s -j (or build the generated Visual Studio solution on Windows)
  111. If you cannot or do not want to build with CMake, there are other options,
  112. described in the following.
  113. BUILDING - USING VCPKG
  114. ======================
  115. You can download and install poco using the vcpkg (https://vcpkg.io)
  116. dependency manager:
  117. $ git clone https://github.com/Microsoft/vcpkg.git
  118. $ cd vcpkg
  119. $ ./bootstrap-vcpkg.sh
  120. $ ./vcpkg integrate install
  121. $ ./vcpkg install poco
  122. The Poco port in vcpkg is kept up to date by Microsoft team members and community contributors.
  123. If the version is out of date, please create an issue or pull request(https://github.com/Microsoft/vcpkg)
  124. on the vcpkg repository.
  125. BUILDING - USING CONAN
  126. ======================
  127. You can download and install poco using the Conan(https://github.com/conan-io/conan)
  128. package manager. It needed to be installed first(https://conan.io/downloads.html):
  129. You can install Poco libraries from Conan Center(https://conan.io/center.html):
  130. $ conan install -r conancenter poco/1.13.3@
  131. Or, you can download Poco recipe and build locally:
  132. $ conan install -r conancenter poco/1.13.3@ --build=poco
  133. The Poco recipe and packages in Conan Center are kept up to date by Conan team members and community contributors.
  134. If the version is out of date, or you detect any wrong behavior, please create an issue or pull request(https://github.com/conan-io/conan-center-index)
  135. on the Conan Center Index repository.
  136. BUILDING ON WINDOWS
  137. ===================
  138. Microsoft Visual Studio 2019 or newer is required to build the POCO C++ Libraries on
  139. Windows platforms. Solution and project files for Visual Studio 2019 to 2022 are included.
  140. 64-bit (x64) builds are supported as well.
  141. You can either build from within Visual Studio (Build->Batch Build->Select All;Rebuild)
  142. or from the command line. To build from the command line, start the
  143. Developer PowerShell for Visual Studio and cd to the directory where you
  144. have extracted the POCO C++ Libraries sources. Then, run the buildwin.ps1 script
  145. and pass the desired options.
  146. To show available options, run:
  147. > buildwin.ps1 -help
  148. Example:
  149. > buildwin.ps1 -vs 170 -action build -linkmode shared -config release -platform x64 -samples -tests
  150. Certain libraries, like NetSSL_OpenSSL, Crypto or Data/MySQL have dependencies
  151. to other libraries. The Visual Studio project files have been configured to
  152. use vcpkg to install the required packages.
  153. In order to run the test suite and the samples, the top-most bin directory containing
  154. the shared libraries must be in the PATH environment variable.
  155. IMPORTANT NOTE: Please make sure that the path to the directory containing the
  156. POCO C++ Libraries source tree does not contain spaces. Otherwise, the Microsoft
  157. message compiler may fail when building the Foundation library.
  158. BUILDING ON UNIX/LINUX/macOS
  159. ============================
  160. For building on Unix platforms, the POCO C++ Libraries come with their own
  161. build system. The build system is based on GNU Make 5.0 (or newer), with the help
  162. from a few shell scripts. If you do not have GNU Make 5.0 (or later) installed on
  163. your machine, you will need to download it from
  164. http://directory.fsf.org/devel/build/make.html>,
  165. build and install it prior to building the POCO C++ Libraries.
  166. You can check the version of GNU Make installed on your system with
  167. > make --version
  168. or
  169. > gmake --version
  170. Once you have GNU Make up and running, the rest is quite simple.
  171. To extract the sources and build all libraries, testsuites and samples, simply
  172. > gunzip poco-X.Y.tar.gz
  173. > tar -xf poco-X.Y.tar
  174. > cd poco-X.Y
  175. > ./configure
  176. > make -s
  177. See the configure script source for a list of possible options.
  178. For starters, we recommend --no-tests and --no-samples, to reduce build times.
  179. On a multicore or multiprocessor machine, use parallel makes to speed up
  180. the build (make -j4).
  181. Once you have successfully built POCO, you can install it
  182. to /usr/local (or another directory specified as parameter
  183. to configure --prefix=<path>):
  184. > sudo make -s install
  185. You can omit certain components from the build. For example, you might
  186. want to omit Data/ODBC or Data/MySQL if you do not have the corresponding
  187. third-party libraries (iodbc or unixodbc, mysqlclient) installed
  188. on your system. To do this, use the --omit argument to configure:
  189. > ./configure --omit=Data/ODBC,Data/MySQL
  190. IMPORTANT: Make sure that the path to the build directory does not
  191. contain symbolic links. Furthermore, on macOS (or other systems
  192. with case insensitive filesystems), make sure that the characters in
  193. the path have the correct case. Otherwise you'll get an error saying
  194. "Current working directory not under $PROJECT_BASE.".
  195. BUILDING ON QNX NEUTRINO
  196. ========================
  197. For QNX Neutrino, the Unix build system (see the instructions above) is used.
  198. You can use the build system to cross-compile for a target platform on a Solaris or
  199. Linux host. Unfortunately, the Cygwin-based Windows host environment has some major
  200. quirks that prevent the build system from working there. You can also use the
  201. build system on a self-hosted QNX system. The default build configuration for QNX
  202. (found in build/config/QNX) is for a self-hosted x86 platform. To specify another
  203. target, edit the CCVER setting in the build configuration file. For example, to
  204. compile for a PowerPC target, specify CCVER=3.3.1,gcc_ntoppcbe.
  205. Service Pack 1 for QNX Neutrino 6.3 must be installed, otherwise compiling the
  206. Foundation library will fail due to a problem with the <list> header in the
  207. default (Dinkumware) C++ standard library.
  208. When building on QNX, you might want to disable NetSSL_OpenSSL, Crypto and
  209. some Data connectors, unless you have the necessary third party components
  210. available:
  211. > ./configure --omit=NetSSL_OpenSSL,Crypto,Data/ODBC,Data/MySQL
  212. BUILDING FOR VXWORKS
  213. ====================
  214. Please see the VxWorks Platform Notes in the Reference Documentation for
  215. more information. The Reference Documentation can be found online
  216. at <http://pocoproject.org/docs/>.
  217. MORE INFORMATION
  218. ================
  219. For more information, see the POCO C++ Libraries website
  220. at <https://pocoproject.org>.