I downloaded the win32 curl library. There is a library with the .a extension. How to connect it to the project? I use MinGW Studio

  • Where did they get the manuals for use? - αλεχολυτ
  • What project? What is the build system? - user1056837
  • How to understand what project? personal project. I collect under win 32. Just the file itself, I downloaded the curl there were header files, I threw them, then there were more files with the extension .a, here’s how to attach them to MinGW Studio - Corle

1 answer 1

The first thing to do after unpacking the archive with the library is to specify additional paths by which the compiler will be able to find its header files, and the linker will find the library itself. Accordingly, the archive should contain at least these folders, with all the necessary files inside:

 bin\ - *.dll include\ - *.h lib\ - *.a 

For MinGW, I can recommend this repository:

Paths can be specified either through the global settings Edit - Options - Directories , or, in each project and in each configuration ( Debug / Release ) separately, through the Project - Settings :

  • on the Compile tab, in Additional include directories you need to enter the full path to the include folder:

Compile tab

  • on the Link tab, in the Additional library path - the full path to the lib folder:

Link tab

Finally, on the Link tab, in the Libraries field you need to enter the name of the link library, without the lib prefix and without the extension . Those. if the file is on disk under the name libcurldll.a , then we should write it as curldll .

After that, you can collect the project. And in order for the compiled exe start, the dependent libcurl.dll must be located next to it: libcurl.dll , libcrypto-1_1.dll , libssl-1_1.dll (or they must be in the PATH ).

And by the way, MinGW Studio is needed with GCC 4.8.1 and in the compilation settings you must specify the -std=c99 flag. Otherwise, nothing will compile.