libmicrohttpd
[Top][All Lists]
Advanced

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

Re: [libmicrohttpd] libmicrohttpd-0.4.4 on Windows


From: Michael Lenaghan
Subject: Re: [libmicrohttpd] libmicrohttpd-0.4.4 on Windows
Date: Wed, 6 Jan 2010 13:24:15 -0500

> OK, here it is: de.gnunet.org/download/MHD-0.4.4-no-ssl.zip

Thanks; that did it!

> But I think Christian will have to consider a new release with the
> change I suggested. If all of that code really is running during
> DllMain() it's bad news.
>
> I'll look into this later. I agree that problems are difficult to diagnose
> that way, but I haven't seen any problems *caused* by this so far.

You mean other than the fact that the currently posted binaries don't
work for either one of us? :-) The Microsoft article is pretty clear:
DllMain() is for initializing memory and kernel objects and really
little more.

> (Btw, when I compiled plibc 0.1.5 last night it looked
> like there was a missing link option for libintl.
>
> Interesting. Can you send me more information about that?

$ cd PlibC-0.1.5
$ ./configure
...
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
$ make
...
/bin/sh ../libtool --mode=link g++  -g -O2  -no-undefined -Wl,--export-all-symbo
ls -lws2_32 -o libplibc.la -rpath /usr/local/lib -export-dynamic -Wl,--no-undefi
ned -Wl,--export-all-symbols -lole32 -lshell32 -lstdc++ -lcomdlg32 -lgdi32 -vers
ion-info 1:0:0 access.lo atoll.lo chdir.lo chmod.lo choosedir.lo choosefile.lo c
lose.lo ctime.lo creat.lo errno.lo flock.lo fopen.lo fread.lo fstat.lo fsync.lo
fwrite.lo kill.lo gettimeofday.lo hsearch.lo hsearch_r.lo inet_pton.lo intl.lo i
net_ntop.lo langinfo.lo lsearch.lo lseek.lo mkstemp.lo mmap.lo open.lo opendir.l
o path.lo pid.lo pipe.lo plibc.lo printf.lo random.lo read.lo readlink.lo realpa
th.lo registry.lo remove.lo rename.lo resolv_ms.lo rmdir.lo select.lo shortcut.l
o socket.lo stat.lo statfs.lo strerror.lo string.lo strptime.lo symlink.lo trunc
ate.lo tsearch.lo unlink.lo write.lo
libtool: link: g++ -shared -nostdlib /mingw/lib/dllcrt2.o c:/mingw/bin/../lib/gc
c/mingw32/3.4.2/crtbegin.o  .libs/access.o .libs/atoll.o .libs/chdir.o .libs/chm
od.o .libs/choosedir.o .libs/choosefile.o .libs/close.o .libs/ctime.o .libs/crea
t.o .libs/errno.o .libs/flock.o .libs/fopen.o .libs/fread.o .libs/fstat.o .libs/
fsync.o .libs/fwrite.o .libs/kill.o .libs/gettimeofday.o .libs/hsearch.o .libs/h
search_r.o .libs/inet_pton.o .libs/intl.o .libs/inet_ntop.o .libs/langinfo.o .li
bs/lsearch.o .libs/lseek.o .libs/mkstemp.o .libs/mmap.o .libs/open.o .libs/opend
ir.o .libs/path.o .libs/pid.o .libs/pipe.o .libs/plibc.o .libs/printf.o .libs/ra
ndom.o .libs/read.o .libs/readlink.o .libs/realpath.o .libs/registry.o .libs/rem
ove.o .libs/rename.o .libs/resolv_ms.o .libs/rmdir.o .libs/select.o .libs/shortc
ut.o .libs/socket.o .libs/stat.o .libs/statfs.o .libs/strerror.o .libs/string.o
.libs/strptime.o .libs/symlink.o .libs/truncate.o .libs/tsearch.o .libs/unlink.o
 .libs/write.o   -lws2_32 -lole32 -lshell32 -lstdc++ -lcomdlg32 -lgdi32 -Lc:/min
gw/bin/../lib/gcc/mingw32/3.4.2 -Lc:/mingw/bin/../lib/gcc -L/mingw/lib/gcc/mingw
32/3.4.2 -Lc:/mingw/bin/../lib/gcc/mingw32/3.4.2/../../../../mingw32/lib -L/ming
w/lib/gcc/mingw32/3.4.2/../../../../mingw32/lib -L/mingw/lib -Lc:/mingw/bin/../l
ib/gcc/mingw32/3.4.2/../../.. -L/mingw/lib/gcc/mingw32/3.4.2/../../.. -lstdc++ -
lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lsh
ell32 -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt c:/mingw/bin/../lib/gcc/ming
w32/3.4.2/crtend.o  -Wl,--export-all-symbols -Wl,--no-undefined -Wl,--export-all
-symbols   -o .libs/libplibc-1.dll -Wl,--enable-auto-image-base -Xlinker --out-i
mplib -Xlinker .libs/libplibc.dll.a
Creating library file: .libs/libplibc.dll.a
.libs/intl.o: In function `win_bindtextdomain':
c:/Downloads/PlibC-0.1.5/src/intl.c:39: undefined reference to `bindtextdomain'
collect2: ld returned 1 exit status
make[3]: *** [libplibc.la] Error 1
make[3]: Leaving directory `/c/Downloads/PlibC-0.1.5/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/c/Downloads/PlibC-0.1.5/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/c/Downloads/PlibC-0.1.5'
make: *** [all] Error 2

>> And my dll ended up
>> rather large because "shortcut.cc" has a ".cc" extension, which
>> triggered compilation as C++. That then linked in the C++ runtime.)
>
> There's no way around that, unfortunately. It uses COM interfaces to read
> Windows shortcuts, this functionality is not exported by any other API
> AFAIK.

COM is compatible with C++ but doesn't require it. The headers should
work with a straight C compiler; indeed, ShObjIdl.h uses:

#if defined(__cplusplus) && !defined(CINTERFACE)
...
#else
...
#endif

to define both interfaces.

Now, having said that, it's been a long time since I've used COM via
C; no doubt there's more to the story. Maybe it's not worth the
effort. But dragging in C++ brings new problems (like C++ exception
handling).

>> Nils, would it be possible to post steps for compiling libmicrohttpd
>> under MinGW?
>
> There's nothing special about it. I compiled the last official release with
>
> ./bootstrap && CFLAGS="-O2 -mtune=pentium -march=pentium -s" ./configure
> --disable-https --prefix= --enable-messages && make install
>
> (bootstrap is not part of the source tarball, we only have it in SVN)

OK, thanks; I'll try that.




reply via email to

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