socket.io-client-cpp icon indicating copy to clipboard operation
socket.io-client-cpp copied to clipboard

No build directory created when building with CMAKE

Open Mart4672 opened this issue 2 years ago • 1 comments

Hi, I'm currently trying to run the console example on a Raspberry Pi CM4 (Raspbian 11). I initially tried to use a Makefile in examples/Console/ to compile main.cpp, but I eventually ran into the error output seen in issue #300 (or something very similar) and was unable to move forward. For reference, here is the Makefile I was testing with:

# Makefile
# run this from the /examples/Console directory

CC = g++
# CFLAGS = -Wall -Werror -Wmissing-prototypes
OBJS = main.o sio_client.o sio_socket.o
PROG = sio_client
LOCALLIBDIR = /usr/local/lib
LDFLAGS = -L$(LOCALLIBDIR)
# LDLIBS  = -lone -ltwo
INC1=-I ../../src/
INC2=-I ../../lib/websocketpp/
INC3=-I ../../lib/asio/asio/include/
INC= $(INC1) $(INC2) $(INC3)
INC4=-I ../../src/internal
# ../../lib/rapidjson/include
# /usr/include/boost

all: $(PROG)

# $(PROG): $(OBJS)
#     $(CC) $(CFLAGS) $(OBJS) -o $@ $(LDFLAGS) $(LDLIBS)
$(PROG): $(OBJS)
	$(CC) -lm $(INC) $(OBJS) -o $@

main.o: main.cpp sio_client.o
	$(CC) -c main.cpp

sio_client.o: ../../src/sio_client.cpp
	$(CC) -c $(INC) -o sio_client.o  ../../src/sio_client.cpp

sio_socket.o: ../../src/sio_socket.cpp
	$(CC) -c $(INC) -o sio_socket.o  ../../src/sio_socket.cpp

sio_client_impl.o: ../../src/internal/sio_client_impl.cpp ../../src/internal/sio_client_impl.h
	$(CC) -c $(INC) $(INC4)  -o sio_client_impl.o  ../../src/internal/sio_client_impl.cpp


.PHONY: clean

clean:
	rm -f *~ *.o $(PROG) core a.out

I then tried to follow the instructions for using CMAKE to build everything, but no build folder is generated:

2023-04-29_cmake_steps

As a reminder, my main goal is to compile examples/Console/main.cpp If anyone sees what I'm doing wrong or is otherwise able to point me in the right direction, that would be greatly appreciated!

Mart4672 avatar Apr 30 '23 05:04 Mart4672

Hi, can you post the error that you are facing?

jmigual avatar Jun 26 '23 09:06 jmigual