I got the temp_conversion
example program from mosquitto C++, from here. I have looked at this thread but I don't quite get it, I have minimal experience with makefiles. I'm not sure if static libraries even work this way, but I have 2 questions:
Is it possible to be able to move the executable to another pc and have it still run? (without installing mosquitto libraries there, maybe copying a static library created by the makefile with it)
How do I convert this makefile to make a static "moveable" executable?
The makefile:
CFLAGS=-Wall -ggdb -I../../lib -I../../lib/cpp
LDFLAGS=-L../../lib ../../lib/cpp/libmosquittopp.so.1 ../../lib/libmosquitto.so.1
.PHONY: all clean
all : mqtt_temperature_conversion
mqtt_temperature_conversion : main.o temperature_conversion.o
${CXX} $^ -o $@ ${LDFLAGS}
main.o : main.cpp
${CXX} -c $^ -o $@ ${CFLAGS}
temperature_conversion.o : temperature_conversion.cpp
${CXX} -c $^ -o $@ ${CFLAGS}
clean :
-rm -f *.o mqtt_temperature_conversion