home *** CD-ROM | disk | FTP | other *** search
/ ftp.ncftp.com / ftp.ncftp.com.zip / ftp.ncftp.com / libncftp / libncftp-3.2.5-src.zip / libncftp-3.2.5 / README.txt
Text File  |  2008-07-15  |  5KB  |  89 lines

  1. Since you have the source distribution, you will need to compile the
  2. libraries before you can install them.
  3.  
  4. UNIX INSTRUCTIONS:
  5. ------------------
  6.  
  7. Go to the ../libncftp directory. There is a script you must run which
  8. will checks your system for certain features, so that the library can
  9. be compiled on a variety of UNIX systems.  Run this script by typing
  10. "./configure" in that directory.  After that, you can look at the
  11. Makefile it made if you like, and then you run "make" to create the
  12. "libncftp.a", "libStrn.a", and "libsio.a" library files.
  13.  
  14. Finally, install the libraries and headers, by doing "make install".
  15.  
  16. View the libncftp.html file for the rest of the documentation.  An easy
  17. way to do that is use a URL of file://Localhost/path/to/libncftp.html
  18. with your favorite browser.
  19.  
  20.  
  21. WINDOWS INSTRUCTIONS:
  22. ---------------------
  23.  
  24. You will need Visual C++ 2005 or greater to build the library and sample
  25. programs.  This version includes two supplementary libraries which you
  26. must build and link with your applications: a string utility library
  27. (Strn) and a Winsock utility library (sio).
  28.  
  29. Keep the source hierarchy intact, so that the samples and libraries
  30. build without problems.  Each project directory contains a visual studio
  31. project (.vcproc and .sln files), but you don't need to manually build
  32. each project.  Instead, open the "LibNcFTP_ALL.sln" workspace file
  33. in the libncftp directory, and then "Build Solution" to build all the
  34. libraries and all the samples.
  35.  
  36. View the libncftp.html file for the rest of the documentation.  An easy
  37. way to do that is use a URL of file://Localhost/path/to/libncftp.html
  38. with your favorite browser.  Note that there may be UNIX-specific
  39. instructions which you should ignore.
  40.  
  41. To build your own applications using LibNcFTP, you'll need to make sure
  42. you configure your project to find the header files and library files.
  43.  
  44. Your application may not need to use the sio or Strn libraries directly,
  45. but you still need to link with them.  For example, the "simpleget" sample
  46. uses "..\..\$(ConfigurationName),..\..\..\Strn\$(ConfigurationName),..\..\..\sio\$(ConfigurationName)"
  47. in the project option for additional library paths for the linker, and
  48. "ws2_32.lib libncftp.lib Strn.lib sio.lib" for the list of libraries
  49. to link with, where the system Winsock (ws2_32.lib) is also linked in.
  50.  
  51. Similarly, you'll need to make sure one of your additional include
  52. directories points to the LibNcFTP directory containing ncftp.h.  The
  53. "simpleget" sample uses "..\.." since it is in a subdirectory of the
  54. library itself.  If you actually use functions from Strn or sio (as
  55. some of the samples do), you'll need to have your project look in
  56. their directories for their headers as well.
  57.  
  58.  
  59. WINDOWS INSTRUCTIONS FOR CREATING A LIBNCFTP PROJECT FROM SCRATCH:
  60. ------------------------------------------------------------------
  61.  
  62. Let's assume you have installed the library and header files, with sio.lib,
  63. Strn.lib, and libncftp.lib in the directory C:\local\lib, and the sio.h,
  64. Strn.h, ncftp.h, and ncftp_errno.h in the directory C:\local\include.
  65.  
  66. Create a new project from within the Visual Studio IDE.  In this example,
  67. we're just re-creating the simpleget sample program as a separate project,
  68. so we choose Win32 Console Application as the project type.  Step through
  69. the wizard and choose "Console application" as the Application type and
  70. click the "Empty project" checkbox, then finish the wizard.
  71.  
  72. Copy the file libncftp\samples\simpleget\simpleget.c to the newly created
  73. project's source directory.  Right click on the project's Source folder
  74. in the Solution Explorer tab and do "Add > Existing item..." then browse
  75. for the simpleget.c file you just copied.
  76.  
  77. Right click on the project and choose "Properties."  Under the "Configuration:"
  78. menu, choose "All Configurations" so that the changes we make here will
  79. apply to both the Debug and Release configurations.  Under the "Configuration
  80. Properties" section, view the first page of the "C++" section ("General").
  81. Enter "C:\local\include" in the "Additional Include Directories."  
  82.  
  83. Next, view the first page of the "Linker" section ("General"), and enter
  84. "C:\local\lib" in the "Additional Library Directories" field.  Then proceed
  85. to the "Input" page of the "Linker" section and in the "Additional
  86. Dependencies" field, enter "ws2_32.lib libncftp.lib Strn.lib sio.lib".
  87.  
  88. Finally, "Build Solution" and the result should be a working application.
  89.