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.