0

Is it possible to compile Paho CPP as a static executable? If so - how?

Here is an example of the compilation statement for one of the examples:

g++ -DOPENSSL -I.. -I/usr/local/include -D_NDEBUG -Wall -std=c++11 -O2 -o data_publish data_publish.cpp -L../../lib -L/usr/local/lib -lpaho-mqttpp3 -lpaho-mqtt3a

How do I compile this as a static executable?

Robben_Ford_Fan_boy
  • 8,494
  • 11
  • 64
  • 85

1 Answers1

0

Build Paho with static libraries.

And then link it with -static command line switch. E.g. g++ ... -static -lpaho-mqttpp3 -lpaho-mqtt3a.

Maxim Egorushkin
  • 131,725
  • 17
  • 180
  • 271