libhttp icon indicating copy to clipboard operation
libhttp copied to clipboard

Compiling on Windows

Open MyTDT-Mysoft opened this issue 3 years ago • 7 comments

so i'm compiling on windows using mingw 8.1 and regular cmd.exe compiling works, altough "clean" uses linux specific stuff that fails to cleanup properly nonetheless it compiles

however i noticed a few things when compiling the simplest make lib/slib forms:

  1. it requires libpthread-1.dll just for clock_gettime. so i added a clock_gettime.c to sources on windows, so that libpthread is not included if used just for that
  2. its requiring a mingw gcc dll for div??? when generating the .dll as dependency that i removed by adding -static-libgcc to compile options.. so now just a warning left..

MyTDT-Mysoft avatar Aug 16 '20 20:08 MyTDT-Mysoft

I used part of code in window vsstudio2017 it could fit ,I didnt USE MINGW in Win.

datrilla avatar Aug 17 '20 00:08 datrilla

whats the point of using this possibly with less features library instead of libcurl

bugproof avatar Aug 17 '20 08:08 bugproof

whats the point of drinking pepsi when we already have coca-cola? anyway i dunno libcurl is fine in most cases, but who knows its good to have alternatives, maybe libcurl becomes a bloated monster, that fails to compile for XP or certain embedded system because it may end too advanced features or being end harder to compile for certain toolchain, or whatever, so its good to have an alternative, specially one that is in C as well :) not to mention if theres some zero day acting on libcurl it may not affect this one

MyTDT-Mysoft avatar Aug 17 '20 11:08 MyTDT-Mysoft

@MyTDT-Mysoft that's true but also maintenance is an important factor. Last commit in this repo was 12 months ago, so if something breaks or there's zero day acting on libhttp you are on your own because nobody maintains it anymore and the author simply abandoned the project. Last commit in libcurl repo was 4 hours ago. But it's also true that there aren't many HTTP clients for C but I think it's good because having too many libraries is overwhelming.

bugproof avatar Aug 17 '20 16:08 bugproof

Nice conversation here :smiley: This project is not abandoned, and the source code is maintained, although not all changes are pushed straight away to the git repository.

Mingw on Windows has not been tested by me, so it may require some adaptations before it compiles smoothly.

lammertb avatar Aug 18 '20 12:08 lammertb

Update on this: MinGW will be supported soon.

lammertb avatar Jun 09 '21 08:06 lammertb

whats the point of using this possibly with less features library instead of libcurl

libcurl is a client-side httplib, this is a server-side httplib which is quite different, am I missing something?

laoshaw avatar Jul 20 '22 19:07 laoshaw