README.msvc 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. ___ __ _ _ __ ___ ___
  2. / __| ___ / _` | '__/ _ \/ __|
  3. | (_ |___| (_| | | | __/\__ \
  4. \___| \__,_|_| \___||___/
  5. How to build c-ares using MSVC or Visual Studio
  6. =================================================
  7. How to build using MSVC from the command line
  8. ---------------------------------------------
  9. Open a command prompt window and ensure that the environment is properly
  10. set up in order to use MSVC or Visual Studio compiler tools.
  11. Change to c-ares source folder where Makefile.msvc file is located and run:
  12. > nmake -f Makefile.msvc
  13. This will build all c-ares libraries as well as three sample programs.
  14. Once the above command has finished a new folder named MSVCXX will exist
  15. below the folder where makefile.msvc is found. The name of the folder
  16. depends on the MSVC compiler version being used to build c-ares.
  17. Below the MSVCXX folder there will exist four folders named 'cares',
  18. 'ahost', and 'adig'. The 'cares' folder is the one that
  19. holds the c-ares libraries you have just generated, the other three
  20. hold sample programs that use the libraries.
  21. The above command builds four versions of the c-ares library, dynamic
  22. and static versions and each one in release and debug flavours. Each
  23. of these is found in folders named dll-release, dll-debug, lib-release,
  24. and lib-debug, which hang from the 'cares' folder mentioned above. Each
  25. sample program also has folders with the same names to reflect which
  26. library version it is using.
  27. How to install using MSVC from the command line
  28. -----------------------------------------------
  29. In order to allow easy usage of c-ares libraries it may be convenient to
  30. install c-ares libraries and header files to a common subdirectory tree.
  31. Once that c-ares libraries have been built using procedure described above,
  32. use same command prompt window to define environment variable INSTALL_DIR
  33. to designate the top subdirectory where installation of c-ares libraries and
  34. header files will be done.
  35. > set INSTALL_DIR=c:\c-ares
  36. Afterwards, run following command to actually perform the installation:
  37. > nmake -f Makefile.msvc install
  38. Installation procedure will copy c-ares libraries to subdirectory 'lib' and
  39. c-ares header files to subdirectory 'include' below the INSTALL_DIR subdir.
  40. When environment variable INSTALL_DIR is not defined, installation is done
  41. to c-ares source folder where Makefile.msvc file is located.
  42. Relationship between c-ares library file names and versions
  43. -----------------------------------------------------------
  44. c-ares static release library version files:
  45. libcares.lib -> static release library
  46. c-ares static debug library version files:
  47. libcaresd.lib -> static debug library
  48. c-ares dynamic release library version files:
  49. cares.dll -> dynamic release library
  50. cares.lib -> import library for the dynamic release library
  51. cares.exp -> export file for the dynamic release library
  52. c-ares dynamic debug library version files:
  53. caresd.dll -> dynamic debug library
  54. caresd.lib -> import library for the dynamic debug library
  55. caresd.exp -> export file for the dynamic debug library
  56. caresd.pdb -> debug symbol file for the dynamic debug library
  57. How to use c-ares static libraries
  58. ----------------------------------
  59. When using the c-ares static library in your program, you will have to
  60. define preprocessor symbol CARES_STATICLIB while building your program,
  61. otherwise you will get errors at linkage stage.
  62. Have Fun!