⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 install.devcpp

📁 功能最强大的网络爬虫,希望大家好好学习啊,好好研究啊
💻 DEVCPP
字号:
DevCpp-Mingw Install & Compilation                                   Sept 2005==================================Reference Emails available at curl@haxx.se:   Libcurl Install and Use Issues  Awaiting an Answer for Win 32 Install   res = curl_easy_perform(curl); Error  Makefile Issues  Having previously done a thorough review of what was available that met myrequirements under GPL, I settled for Libcurl as the software of choice formany reasons not the least of which was the support.Background----------This quest started when I innocently tried to incorporate the libcurl libraryinto my simple source code. I figured that a few easy steps would accomplishthis without major headaches. I had no idea that I would be facing an almostinsurmountable challenge.The main problem lies in two areas. First the bulk of support for libcurlexists for a Unix/linux command line environments. This is of little help whenit comes to Windows O/S.Secondly the help that does exist for the Windows O/S focused around mingwthru a command line argument environment.You may ask "Why is this a problem?"I'm using a Windows O/S with DevCpp. For those of you who are unfamiliar withDevCpp, it is a window shell GUI that replaces the command line environmentfor gcc. A definite improvement that I am unwilling to give up. However usingDevCpp presented its own set of issues. Inadvertently I also made somecareless errors such as compiling the 7.14 version of Makefile with an olderversion of source code. Thanks to Dan Fandrich for picking this up.I did eventually with the help of Daniel, Phillipe and others manage toimplement successfully (the only mingw available version)curl-7.13.0-win32-ssl-devel-mingw32 into the DevCpp environment. Only thedynamic libcurl.dll libcurldll.a libraries worked. The static library which Iwas interested in did not. Furthermore when I tried to implement one of theexamples included with the curl package (get info.c) it caused the executableto crash. Tracing the bug I found it in the code and function res =curl_easy_perform(curl);.At this point I had to make a choice as to whether invest my limitedtime-energy resource to fixing the bug or to compile the new versionavailable. After searching the archives I found a very similar or the same bugreported from version 7.12x on. Daniel did inform me that he thought that thisbug had been fixed with the latest version. So I proceeded to compile thelatest SSL version where I faced other challenges.In order to make this process unremarkable for others using the sameenvironment I decided to document the process so that others will find itroutine. It would be a shame if newbies could not implement this excellentpackage for their use.I would like to thank the many others in this forum and in the DevCpp forumfor their help. Without your help I may either have given up or it would havetaken me many times longer to achieve success.The Cookbook Approach---------------------This discussion will be confined to a SSL static library compilation andinstallation. Limited mention and comments will be inserted where appropriateto help with non-SSL, dynamic libraries and executables.   Using Makefile from DevCpp to compile Libcurl librariesPreamble--------Using the latest version release - curl-7.14.0.tar.gz. Curl source code isplatform independent. This simply means that the source code can be compiledfor any Operating System (Linux/Unix Windows etc. and variations of thereof).The first thing to note is that inside curl-7.14.0 you will find two folderslib and src. Both contain Makefile.m32 (required for win mingw library or execompilation) files which are different. The main difference between these twofolders and the makefiles is that the src folder contents are used to compilean executable file(curl.exe) while the lib folder contents are used to compilea static (libcurl.a) and dynamic (libcurl.dll & libcurldll.a) file that can beused to compile libcurl with your own source code so that one can use andaccess all libcurl functions.Before we start please make sure that DevCpp is installed properly. Inparticular make sure you have no spaces in the name of any of the directoriesand subdirectories where DevCpp is installed. Failure to comply with theinstall instructions may produce erratic behaviour in DevCpp. For further infocheck the following siteshttp://aditsu.freeunixhost.com/dev-cpp-faq.htmlhttp://sourceforge.net/forum/message.php?msg_id=3252213As I have mentioned before I will confine this to the SSL Library compilationsbut the process is very similar for compilation of the executable - curl.exe;just substitute the src folder makefile in its stead.First use a text processor Notepad, or your own favourite text processor. Toengage your favourite text processor, select Makefile.m32 click once with yourmouse on file icon; icon turns blue, press the shift key and right-click onmouse, menu appears select "Open with", select your favourite text processor.Next read the contents of Makefile.m32. It includes instructions on its use.Method I - DOS Command Line--------------------------- Note - The only reason I have included this method is that Method II which isthe preferred method for compiling does not allow for the setting of optionswitches (e.g. SSL = 1 or SSL =0). At least that's what they tell me at theDev-Cpp forum.1 - Make a copy of (D:\Dev-Cpp\bin) bin folder and name it "bin Original"place it in the Dev-Cpp installed directory (D:\Dev-Cpp\ for this example)2 - Copy the entire contents of the LIB folder of curl-7.14.0.tar.gz or zipversion into the bin folder above (D:\Dev-Cpp\bin). The reason being is thatthe make.exe file resides in this folder. Make.exe will use - Makefile.m32,Makefile.inc, and the source code included in the lib folder to compile thesource code. There is a PATH issue with make.exe that remains unresolved atleast for me. Unless the entire source code to be compiled is placed entirelywithin the directory of make.exe an error message will be generated - "filexxxx.yyy not available".3- Go to Dev-Cpp\bin and double click on make .exe. You will see a DOS windowquickly pop up and close very quickly. Not to worry! Please do not skip thisstep.4- Click on the start button\Programs\MS-DOS Prompt.Once the DOS Window is upType the disk drive letter (e.g. E: ) engage the enter button. The path shouldautomatically take you to the directory of the make.exe file.5- To compile the source code simply type at the DOS prompt make -fMakefile.m32 as per instructions contained in the Makefile.m32 file (use anytext processor to read instructions). I don't believe that this makefileallows for the option of non SSL. Ignore any warnings.6- Collect and make copies of libcurl.a, libcurl.dll, libcurldll.a and any *.ocompilations you might need in another directory outside of the bin directoryas you will need this files shortly to set up libcurl for use withDev-cpp. For most apps *.o is not required. Later on we will show what to dowith these files.7- You are finished but before closing we need to do cleanup - erase the binfolder and rename the "bin Original" folder created in step 1 to bin.Note to compile a curl executable the process is probably similar but insteadof using the LIB folder contents use the SRC folder contents and Makefiles incurl-7.14.0.tar.gz. File directories relative placements must be respected forcompiling to take place successfully. This may not be possible with the PATHproblem that make.exe experiences. If anyone has solved this PATH issue andplease make sure it actually works on Win 9x/2000/XP before letting meknow. Then please let me or Daniel in on the solution so that it can beincluded with these instructions. Thanks.orMethod II - Dev-Cpp GUI-----------------------1- Copy the entire contents of the LIB folder of curl-7.14.0.tar.gz or zipversion into any folder outside of (Dev-Cpp\bin).2- Drop the File/New/click on Project.3- New Project Dialogue box appears. Double click on the Static Library.4- Create Project Dialogue box appears. Select the LIB folder location toplace and locate your Project File Name. Placing the Project File Nameelsewhere may cause problems (PATH issue problem again).5- Drop down the Project/Project Options. Project Options Dialogue boxappears.6- Select the Makefile tab in the Project Options Dialogue Box. Check Box -Use Custom Makefile. Click on the Folder icon at the extreme right of theCheck Box. Select Makefile.m32 in the folder wherever you have placed thecontents of the LIB Folder. Press OK and close the Dialogue Box.7- Drop the Menu Project/Click on Add to Project. Open File Dialogue Boxappears.  The Dialogue Box should open in the folder wherever you have placedthe contents of the LIB Folder. If not go there.8- Select Crtl-A to select all files in the LIB folder. Click on open to addfiles and close box. Wait till all files are added. This may take 30 secondsor longer.9- Drop the Menu Execute/Click on Compile. 10- That's it.   The following steps must be completed if Curl is to work properly   =================================================================LIB folder inclusions (*.a placement)-------------------------------------1- Refer to Method I - DOS Command Line point # 6 Take libcurl.a, libcurldll.aand install it in the directory C( or whichever drive Dev is installed):\Dev-Cpp\lib.Include Folder--------------1- Create a new folder by the name of curl (do not change the name curl tosome other name as it will cause major issues) in the directoryC:\Dev-Cpp\include.2- Copy the entire contents of the curl folder of curl-7.14.0.tar.gz or zip version into the newly created curl directory - C:\Dev-Cpp\include\curl.Links To Include And Lib Folder-------------------------------1- Drop the Menu - Tools\Compiler Options\Directories\Libraries. Make surethat C( or whichever drive Dev is installed):\DEV-CPP\lib is included.2- Next select the Menu - Tools\Compiler Options\Directories\C Includes. Makesure that C:\DEV-CPP\include and C:\Dev-Cpp\include\curl are included.3- Next select the Menu - Tools\Compiler Options\Directories\C++Includes. Make sure that C:\DEV-CPP\include and C:\Dev-Cpp\include\curl areincluded.Linker Links------------1- Drop the Menu - Tools\Compiler Options\Directories\Compiler.2- Make sure that the box "Add these commands to the linker command line" ischecked.3- Include in the white space immediately below the box referred in 2 -lcurl-lws2_32 -lwinmm.SSL Files---------1- Get the latest openSSL (as of time of this writing)openssl-0.9.7e-win32-bin.zip for the minimalist package of the openssl-0.9.7ebinaries ported to MS Windows 95/98/NT/XP using the MingW32/GCC-3.1development environment. The file may be downloaded athttp://curl.haxx.se/download/.2- Open the above zip file. You will find two files - SDL.dll,SDL_mixer.dll. Install them in the directory C:\WINDOWS\SYSTEM32 for Win 9xusers and c:\winnt\system32 for NT-family users.Multithreading Files--------------------To be completed#define-------1- Make sure that your program includes the following - #define CURL_STATICLIBmust be declared FIRST before any other define functions may beadded. Otherwise you may experience link errors.2- Don't forget to include   #include "curl/curl.h".e.g.    #define CURL_STATICLIB #include <windows.h>    #include "curl/curl.h"#include <fstream>#include <iostream>#include <vector>etc...Static or Dynamic Library-------------------------The above steps apply for the use by a static library. Should you choose touse a dynamic library you will be required to perform these additional steps.1- Refer to Method I - DOS Command Line point # 6. Install libcurl.dll in thedirectory C:\WINDOWS\SYSTEM32 for Win 9x users and c:\winnt\system32 forNT-family users.2- Refer to Linker Links point 3 - Replace -lcurl with -lcurldll.Voila you're done.The non-SSL static Library build may not be possible to use at least as of thetime of this writing - v7.14. Check reference emails - Phillipe and I found itimpossible to fully compile as certain files were missing for linking. No bigloss as SSL is a major plus.Hope this HelpsTom

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -