README 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  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 - USING VCPKG
  117. ===================
  118. You can download and install poco using the vcpkg(https://github.com/Microsoft/vcpkg)
  119. dependency manager:
  120. $ git clone https://github.com/Microsoft/vcpkg.git
  121. $ cd vcpkg
  122. $ ./bootstrap-vcpkg.sh
  123. $ ./vcpkg integrate install
  124. $ ./vcpkg install poco
  125. The poco port in vcpkg is kept up to date by Microsoft team members and community contributors.
  126. If the version is out of date, please create an issue or pull request(https://github.com/Microsoft/vcpkg)
  127. on the vcpkg repository.
  128. BUILDING - USING CONAN
  129. ======================
  130. You can download and install poco using the Conan(https://github.com/conan-io/conan)
  131. package manager. It needed to be installed first(https://conan.io/downloads.html):
  132. You can install Poco libraries from Conan Center(https://conan.io/center.html):
  133. $ conan install -r conancenter poco/1.12.0@
  134. Or, you can download Poco recipe and build locally:
  135. $ conan install -r conancenter poco/1.12.0@ --build=poco
  136. The Poco recipe and packages in Conan Center are kept up to date by Conan team members and community contributors.
  137. 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)
  138. on the Conan Center Index repository.
  139. BUILDING ON WINDOWS
  140. ===================
  141. Microsoft Visual Studio 2015 or newer is required to build the POCO C++ Libraries on
  142. Windows platforms. Solution and project files for all versions from 2015 to 2022 are included.
  143. 64-bit (x64) builds are supported as well.
  144. You can either build from within Visual Studio (Build->Batch Build->Select All;Rebuild)
  145. or from the command line. To build from the command line, start the
  146. Visual Studio Command Prompt and cd to the directory where you
  147. have extracted the POCO C++ Libraries sources. Then, simply start the buildwin.cmd script
  148. and pass as argument the version of visual studio (140, 150, 160, 170, etc.). You can customize
  149. what is being built by buildwin.cmd by passing appropriate command line arguments to
  150. it. Call buildwin.cmd without arguments to see what is available.
  151. To disable certain components (e.g., NetSSL_OpenSSL or Data/MySQL) from the build,
  152. edit the file named "components" and remove the respective lines.
  153. Certain libraries, like NetSSL_OpenSSL, Crypto or Data/MySQL have dependencies
  154. to other libraries. Since the build script does not know where to find the necessary
  155. header files and import libraries, you have to either add the header file paths to
  156. the INCLUDE environment variable and the library path to the LIB environment variable,
  157. or you'll have to edit the buildwin.cmd script, where these environment variables can
  158. be set as well.
  159. In order to run the test suite and the samples, the top-most bin directory containing
  160. the shared libraries must be in the PATH environment variable.
  161. IMPORTANT NOTE: Please make sure that the path to the directory containing the
  162. POCO C++ Libraries source tree does not contain spaces. Otherwise, the Microsoft
  163. message compiler may fail when building the Foundation library.
  164. BUILDING ON UNIX/LINUX/macOS
  165. ============================
  166. For building on Unix platforms, the POCO C++ Libraries come with their own
  167. build system. The build system is based on GNU Make 5.0 (or newer), with the help
  168. from a few shell scripts. If you do not have GNU Make 5.0 (or later) installed on
  169. your machine, you will need to download it from
  170. http://directory.fsf.org/devel/build/make.html>,
  171. build and install it prior to building the POCO C++ Libraries.
  172. You can check the version of GNU Make installed on your system with
  173. > gmake --version
  174. or
  175. > make --version
  176. Once you have GNU Make up and running, the rest is quite simple.
  177. To extract the sources and build all libraries, testsuites and samples, simply
  178. > gunzip poco-X.Y.tar.gz
  179. > tar -xf poco-X.Y.tar
  180. > cd poco-X.Y
  181. > ./configure
  182. > gmake -s
  183. See the configure script source for a list of possible options.
  184. For starters, we recommend --no-tests and --no-samples, to reduce build times.
  185. On a multicore or multiprocessor machine, use parallel makes to speed up
  186. the build (make -j4).
  187. Once you have successfully built POCO, you can install it
  188. to /usr/local (or another directory specified as parameter
  189. to configure --prefix=<path>):
  190. > sudo gmake -s install
  191. You can omit certain components from the build. For example, you might
  192. want to omit Data/ODBC or Data/MySQL if you do not have the corresponding
  193. third-party libraries (iodbc or unixodbc, mysqlclient) installed
  194. on your system. To do this, use the --omit argument to configure:
  195. > ./configure --omit=Data/ODBC,Data/MySQL
  196. IMPORTANT: Make sure that the path to the build directory does not
  197. contain symbolic links. Furthermore, on macOS (or other systems
  198. with case insensitive filesystems), make sure that the characters in
  199. the path have the correct case. Otherwise you'll get an error saying
  200. "Current working directory not under $PROJECT_BASE.".
  201. BUILDING ON QNX NEUTRINO
  202. ========================
  203. For QNX Neutrino, the Unix build system (see the instructions above) is used.
  204. You can use the build system to cross-compile for a target platform on a Solaris or
  205. Linux host. Unfortunately, the Cygwin-based Windows host environment has some major
  206. quirks that prevent the build system from working there. You can also use the
  207. build system on a self-hosted QNX system. The default build configuration for QNX
  208. (found in build/config/QNX) is for a self-hosted x86 platform. To specify another
  209. target, edit the CCVER setting in the build configuration file. For example, to
  210. compile for a PowerPC target, specify CCVER=3.3.1,gcc_ntoppcbe.
  211. Service Pack 1 for QNX Neutrino 6.3 must be installed, otherwise compiling the
  212. Foundation library will fail due to a problem with the <list> header in the
  213. default (Dinkumware) C++ standard library.
  214. When building on QNX, you might want to disable NetSSL_OpenSSL, Crypto and
  215. some Data connectors, unless you have the necessary third party components
  216. available:
  217. > ./configure --omit=NetSSL_OpenSSL,Crypto,Data/ODBC,Data/MySQL
  218. BUILDING FOR VXWORKS
  219. ====================
  220. Please see the VxWorks Platform Notes in the Reference Documentation for
  221. more information. The Reference Documentation can be found online
  222. at <http://pocoproject.org/docs/>.
  223. MORE INFORMATION
  224. ================
  225. For more information, see the POCO C++ Libraries website
  226. at <http://pocoproject.org>.