error while loading shared libraries: libwebsockets.so.17: cannot open shared object file

libwebsockets示例提供了如下编译方法

cmake . && make

自己写的代码编译方法如下

gcc -o server main.c -lwebsockets

结果报错:

./server : error while loading shared libraries: libwebsockets.so.17: cannot open shared object file: No such file or directory

解决办法:

If you've installed libwebsockets with make install then you probably just need to run sudo ldconfig to update the linker cache.

执行如下命令

sudo ldconfig

error: conversion to ‘long int’ from ‘long unsigned int’ may change the sign of the result

注释掉 CMakeLists.txt 736 行下面内容即可

#	if ("${DISABLE_WERROR}" STREQUAL "OFF")
#		set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
#	endif()

猜你喜欢

转载自blog.csdn.net/qq_44519484/article/details/112823910