Closed alexe100 closed 4 years ago
Hello,
This could have many reasons.
What OS/version are you using?
Do you have ulfius already installed as a package?
What is the content of the file /usr/local/include/ulfius-cfg.h
?
Usually this error is because another version of ulfius is already installed.
Also try to compile the example programs with cmake: https://github.com/babelouest/ulfius/blob/master/example_programs/README.md
ubuntu 19 I never installed it as a package. I compiled from sources.
/ #undef U_DISABLE_JANSSON / / #undef U_DISABLE_CURL / / #undef U_DISABLE_GNUTLS /
/ #undef U_DISABLE_YDER / / #undef U_WITH_FREERTOS / / #undef U_WITH_LWIP /
Why does #define U_DISABLE_WEBSOCKET exists in there?
It seems that cmake does not compile the websocket_example. Hence, I compile it using make.
I still can't reproduce your problem. It seems that you used the build static mode and enable the option WITH_WEBSOCKET
so I used them too.
I run a Ubuntu 19.10, build ulfius using cmake with the following command:
$ mkdir build && cd build
$ cmake -DBUILD_STATIC=on -DWITH_WEBSOCKET=on ..
-- The C compiler identification is GNU 9.2.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Looking for __GNU_LIBRARY__
-- Looking for __GNU_LIBRARY__ - found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found GnuTLS: /usr/lib/x86_64-linux-gnu/libgnutls.so (found version "3.6.9")
-- Found mhd: /usr/local/lib/libmicrohttpd.so (found version "0.9.66")
-- Found CURL: /usr/lib/x86_64-linux-gnu/libcurl.so (found version "7.65.3")
-- Found Jansson: /usr/lib/x86_64-linux-gnu/libjansson.so (found version "2.12")
-- Found Jansson: /usr/lib/x86_64-linux-gnu/libjansson.so (found suitable version "2.12", minimum required is "2.4")
-- GNU TLS support: ON
-- Websocket support: on
-- Outgoing requests support: ON
-- Jansson library support: ON
-- Yder support: ON
-- Build uwsc application: ON
-- Build static library: on
-- Build testing tree: OFF
-- Install the header files: ON
-- Build RPM package: OFF
-- Build documentation: OFF
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/local/src/ulfius/build
$ make && sudo make install
$ cat /usr/local/include/ulfius-cfg.h
#ifndef _ULFIUS_CFG_H_
#define _ULFIUS_CFG_H_
#define ULFIUS_VERSION 2.6.6
#define ULFIUS_VERSION_STR "2.6.6"
#define ULFIUS_VERSION_MAJOR 2
#define ULFIUS_VERSION_MINOR 6
#define ULFIUS_VERSION_PATCH 6
#define ULFIUS_VERSION_NUMBER ((ULFIUS_VERSION_MAJOR << 16) | (ULFIUS_VERSION_MINOR << 8) | (ULFIUS_VERSION_PATCH << 0))
/* #undef U_DISABLE_JANSSON */
/* #undef U_DISABLE_CURL */
/* #undef U_DISABLE_GNUTLS */
/* #undef U_DISABLE_WEBSOCKET */
/* #undef U_DISABLE_YDER */
/* #undef U_WITH_FREERTOS */
/* #undef U_WITH_LWIP */
#endif /* _ULFIUS_CFG_H_ */
@alexe100 , any update?
no, gave up and looking to microhttpd
On Sun, Apr 12, 2020 at 9:29 PM Nicolas Mora notifications@github.com wrote:
@alexe100 https://github.com/alexe100 , any update?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/babelouest/ulfius/issues/161#issuecomment-612671763, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACVY5FWL5Q4JJMUMX6JO6BTRMIQD7ANCNFSM4MDRERMA .
no problem, happy hacking!
Hi, I am trying to test websocket example. I compiled ulfius with websockets support:
/home/user1/Downloads/ulfius/build/ulfius/build$ cmake .. -DWITH_WEBSOCKET=on -DBUILD_STATIC=on -- Found Jansson: /usr/lib/x86_64-linux-gnu/libjansson.so (found version "2.12") -- Found Jansson: /usr/lib/x86_64-linux-gnu/libjansson.so (found suitable version "2.12", minimum required is "2.4") -- GNU TLS support: ON -- Websocket support: on -- Outgoing requests support: ON -- Jansson library support: ON -- Yder support: ON -- Build uwsc application: ON -- Build static library: on -- Build testing tree: OFF -- Install the header files: ON -- Build RPM package: OFF -- Build documentation: OFF -- Configuring done -- Generating done -- Build files have been written to: /home/user1/Downloads/ulfius/build
Then make & make install Then in:
Downloads/ulfius/example_programs/websocket_example$ make
Then, executin:
./websocket_server Websocket not supported, please recompile ulfius with websocket support
Why?
Thanks