Mingw connection Solution

Source: Internet
Author: User

APR (Apache Portable Runtime) was recently studied, and a smallProgramLink the libapr-1.dll library, compiled with mingw, The result Link error, what to say "undefined reference to XXX"

 

The command I wrote is: gcc-OAPR-test-iinclude-llib-lapr-1 apr-test.c

I downloaded the libapr Binary Package (http://apache.freelamp.com/apr/binaries/win32/). The include and Lib directories have header files and. Lib files, but GCC cannot find the file ....

 

The final solution is: gcc-OAPR-test-iinclude apr-test.c lib/libapr-1.lib

That is, the file name of the. Lib library or. A file is directly appended to the end of the GCC command. The problem is solved.

 

If you need to compile the file first and then link it, you do not need to file it with. Lib during compilation.

 

This method can solve the problem that the mingw cannot find the database, but it does not know why it cannot be used with-L.

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.