How do I include curl library in my C project in Code Blocks (Windows)?

后端 未结 2 1874
傲寒
傲寒 2020-12-20 07:29

The question seems straight forward. I tried a lot of things just to include curl in my C project using the code::blocks ide but to no avail.

I would like to use cUR

2条回答
  •  太阳男子
    2020-12-20 07:43

    Go to your project "Build Options" -> "Linker" tab and so you have two choices:

    1. If your library is (correctly) installed system-wide, write in "other linker options" the libs as if you were using your compiler directly. For GCC you'd write -lcurl. You may also use this with a path instruction like Wl,-rpath,/path/to/your/library -lMyLib. Obviously it depends on the compiler and system setup.

    2. Add the library in "Link libraries" on the left. Click the "Add" button and browse to your library file.

    Take a look at this A.3 — Using libraries with Code::Blocks for some pictures. Googling around will show you more.

提交回复
热议问题