libmicrohttpd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [libmicrohttpd] Trouble using microhttpd [compiling]


From: Christian Grothoff
Subject: Re: [libmicrohttpd] Trouble using microhttpd [compiling]
Date: Wed, 5 May 2010 12:54:39 +0200
User-agent: KMail/1.12.4 (Linux/2.6.32-trunk-vserver-amd64; KDE/4.3.4; x86_64; ; )

Hi!

You need to include certain standard headers (depending on your platform) 
before you #include "microhttpd.h".  Which one depends on your system, a good 
start is something like this from platform.h (many of these are not actually 
required on most platforms, so if your system doesn't have one of these, 
remove the #include line and try without):

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <unistd.h>
#include <stdarg.h>
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
#include <stddef.h>
#include <pthread.h>
#include <sys/select.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <sys/msg.h>
#include <sys/mman.h>
#include <netdb.h>
#include <netinet/in.h>
#include <time.h>
#include <sys/socket.h>
#include <arpa/inet.h>

Best,

Christian


On Tuesday 04 May 2010 12:43:58 am Alexandre gaudencio wrote:
> Hello,
> I'm mailing asking for some help.
> 
> I've been trying to use libmicrohttpd for 2 days now and I can't get it to
> work and don't understand why ... I'm a not an expert so please forgive me
> if I say something silly.
> 
> Here's what I've done :
> 
> - Downloaded the latest sources (
> ftp://sunsite.cnlab-switch.ch/mirror/gnu/libmicrohttpd/libmicrohttpd-0.4.6.
> tar.gz )
> - Runned :
> tar -xvzf libmicrohttpd-0.4.6.tar.gz
> cd libmicrohttpd-0.4.6
> mkdir /tmp/glibmicrohttpd
> ./configure --prefix=/tmp/microhttpdTest
> make
> make install
> 
> - I copied the sample code found here (
> http://www.gnu.org/software/libmicrohttpd/)
> [http://pastebin.org/199897just so I'm sure everyone get's the same
> sample]
> into a plop.c file and then tried to compile like this :
> 
> address@hidden:/tmp/test $ gcc plop.c -I/tmp/glibmicrohttpd/include/
> -L/tmp/glibmicrohttpd/lib/ -lmicrohttpd
> In file included from plop.c:4:
> /tmp/glibmicrohttpd/include/microhttpd.h:497: error: expected
> specifier-qualifier-list before ‘intptr_t’
> /tmp/glibmicrohttpd/include/microhttpd.h:830: error: expected declaration
> specifiers or ‘...’ before ‘uint64_t’
> /tmp/glibmicrohttpd/include/microhttpd.h:868: error: expected declaration
> specifiers or ‘...’ before ‘uint64_t’
> /tmp/glibmicrohttpd/include/microhttpd.h:893: error: expected declaration
> specifiers or ‘...’ before ‘va_list’
> /tmp/glibmicrohttpd/include/microhttpd.h:1085: error: expected ‘)’ before
> ‘size’
> 
> So here I don't get it =/
> Maybe this is something I did wrong but isn't this header supposed to be
> generated automatically by the configure/make/make install thing and be
> usable directly ?
> 
> I'm using (right now for the tests) the latest Ubuntu release (10.04) but I
> get the same problem (with much more errors though) on Mac OS X Snow
> Leopard.
> 
> Does someone know what to do to get this right ?
> 
> Thanks a lot for any further help !
> 
> Alexandre Gaudencio.
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]