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

No build directory created when building with CMAKE #396

Open
Mart4672 opened this issue Apr 30, 2023 · 1 comment
Open

No build directory created when building with CMAKE #396

Mart4672 opened this issue Apr 30, 2023 · 1 comment

Comments

@Mart4672
Copy link

Mart4672 commented Apr 30, 2023

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!

@jmigual
Copy link
Collaborator

jmigual commented Jun 26, 2023

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

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