Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing linker library "-lmicrohttpd_ws" in "libmicrohttpd.pc" when using the experimental WebSocket support #27

Open
jvo203 opened this issue Feb 29, 2024 · 2 comments

Comments

@jvo203
Copy link

jvo203 commented Feb 29, 2024

The latest libmicrohttpd v1.0.1 can be compiled with the experimental WebSocket upgrade mechanism by issuing ./configure --enable-experimental. When using WebSockets one needs to link with the extra WebSockets functions by adding the extra library -lmicrohttpd_ws.

Unfortunately, the "pkg-config" files does not include this extra library when compiled with the "--enable--experimental":

pkg-config --libs libmicrohttpd
-L/usr/local/lib -lmicrohttpd

even though the extra library is correctly compiled and placed in the destination lib directory:

 ls -l /usr/local/lib/libmicro*
-rwxr-xr-x@ 1 chris  staff   275368  2 29 15:37 /usr/local/lib/libmicrohttpd.12.dylib
-rw-r--r--@ 1 chris  staff  1016488  2 29 15:37 /usr/local/lib/libmicrohttpd.a
lrwxr-xr-x@ 1 chris  staff       22  2 29 15:37 /usr/local/lib/libmicrohttpd.dylib -> libmicrohttpd.12.dylib
-rwxr-xr-x@ 1 chris  staff     1032  2 29 15:37 /usr/local/lib/libmicrohttpd.la
-rwxr-xr-x@ 1 chris  staff    54440  2 29 15:37 /usr/local/lib/libmicrohttpd_ws.0.dylib
-rw-r--r--@ 1 chris  staff    63000  2 29 15:37 /usr/local/lib/libmicrohttpd_ws.a
lrwxr-xr-x@ 1 chris  staff       24  2 29 15:37 /usr/local/lib/libmicrohttpd_ws.dylib -> libmicrohttpd_ws.0.dylib
-rwxr-xr-x@ 1 chris  staff      997  2 29 15:37 /usr/local/lib/libmicrohttpd_ws.la

The solution: add -lmicrohttpd_ws to the libmicrohttpd.pc file that make install places in the /usr/local/lib/pkgconfig folder.

@Karlson2k
Copy link
Owner

microhttpd_ws is experimental and not supported directly.
The proper solution would be creation of libmicrohttpd_ws.pc.
Patches are welcome.

@jvo203
Copy link
Author

jvo203 commented Mar 1, 2024

Sorry I am unable to submit a patch due to being unfamiliar with the autoconfig process like the "configure.ac", "Makefile.am" files etc.

I've forked the libmicrohttpd repository and opened the "configure.ac, Makefile.am" but learning the auto-configuration process completely from scratch would i) take up too much time away from the daily job duties and ii) likely result in mistakes / broken libmicrohttpd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants