Codeblocks using static link libraries

Source: Internet
Author: User
Tags curl idn

A scripting tool that wants to write a curl download tool that saves a lot of pictures or other material in a page.

But after the company is written, it can't be run at home. So I searched the internet for a large circle and found a way to set up codeblocks to use the static link library.

Go to Project builds Options->compiler settings-> #defines: Type in Curl_staticlib. When it is defined the libcurl.h header would have its function signatures preprocessed to fit static linkage. Otherwise dynamic linkage is assumed and the mangled names then become. The unresolved errors from your screenshot indicate it ' s attempting a dynamic link rather than the desired static link.
Under Project build Options->linker settings->link Libraries Make sure it contains the Following:curl, RTMP, IDN, S SL, SSH2, Crypto, Z, ws2_32, Wldap32, winmm, gdi32. Note this is important. Due to a design deficiency of the GNU linker, the most dependant libraries-need to is listed-a-followed-a-least Dant. Other linkers like msvc link and Borland ' s ilinker does not exhibit such--the issues can is libraries in any order.
Under Project Build Options->linker settings->other Linker The options add in '-static '. This would make sure that the static version of the ' IDN ' is used. If This switch are omitted then your compiled program could depend in ' Libidn-11.dll ' to run which probably ' t isn Want.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.