seasocks icon indicating copy to clipboard operation
seasocks copied to clipboard

Seasocks using in my sw

Open aledisi opened this issue 5 years ago • 2 comments

Hi, I'm probably missing something stupid, but i'm trying to develope a software using seasocks for websocket. I followed steps in tutorial to install the library and "build/src/app/c/ws_test" works correctly. Now I started to copy the "ws_test.cpp" code to a file in other directory to test what to do to compile myown software using libsockets libs.

THIS IS MY MAKEFILE:


top_srcdir := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
top_builddir ?= $(CURDIR)
CC=g++ -std=c++11



SEASOCKS := ./seasocks

INCLUDES := -I $(SEASOCKS) -I $(SEASOCKS)/src/main/c/internal -I $(SEASOCKS)/src/main/c/seasocks \
	-I $(SEASOCKS)/src/main/c -I $(SEASOCKS)/build/src/main/c \
	-I /usr/local/include/

LIBS:= -lseasocks
	
LDFLAGS += -L$(SEASOCKS)/build/src/main/c

#LINKLIBS := $(SEASOCKS)/build/src/main/c/libseasocks.so.1.4.3
	
all: serverws

serverws: serverws.cpp
	$(CC) $(INCLUDES) serverws.cpp $(LIBS) $(LDFLAGS) -o serverws

clean:
	rm -rf *.o *.out

The "make" command compile without errors and create serverws executable, but when I try to execute I get: "error while loading shared libraries: libsockets.so.1.4.3 cannot open shared object file: No such file or directory".

I used the same kind of makefile for a lot of project without problems. Someone can help me? Alessandro

aledisi avatar Mar 16 '20 12:03 aledisi

Does it work with the static library?

offa avatar Mar 16 '20 16:03 offa

@aledisi any further thoughts on this? Can you answer @offa 's question? thanks!

mattgodbolt avatar Jan 06 '21 02:01 mattgodbolt