Skip to content

Commit

Permalink
Include <cstdint> when compiling TinyWebSockets.
Browse files Browse the repository at this point in the history
Fixes:

    In file included from external/TinyWebsockets/tiny_websockets_lib/include/tiny_websockets/network/linux/linux_tcp_client.hpp:6,
                     from external/TinyWebsockets/tiny_websockets_lib/include/tiny_websockets/internals/ws_common.hpp:37,
                     from external/TinyWebsockets/tiny_websockets_lib/include/tiny_websockets/internals/wscrypto/crypto.hpp:3,
                     from external/TinyWebsockets/tiny_websockets_lib/src/crypto.cpp:1:
    external/TinyWebsockets/tiny_websockets_lib/include/tiny_websockets/network/tcp_client.hpp:11:29: error: ‘uint8_t’ does not name a type
       11 |     virtual void send(const uint8_t* data, const uint32_t len) = 0;
          |                             ^~~~~~~
    external/TinyWebsockets/tiny_websockets_lib/include/tiny_websockets/network/tcp_client.hpp:5:1: note: ‘uint8_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding ‘#include <cstdint>’
        4 | #include <tiny_websockets/network/tcp_socket.hpp>
      +++ |+#include <cstdint>
        5 |
  • Loading branch information
developer79433 committed Dec 22, 2024
1 parent d39115f commit a22cad0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CXX=g++
# -std=gnu++17
VERSION=OSPI
CXXFLAGS=-std=gnu++14 -D$(VERSION) -DSMTP_OPENSSL -Wall -include string.h -Iexternal/TinyWebsockets/tiny_websockets_lib/include -Iexternal/OpenThings-Framework-Firmware-Library/
CXXFLAGS=-std=gnu++14 -D$(VERSION) -DSMTP_OPENSSL -Wall -include string.h -include cstdint -Iexternal/TinyWebsockets/tiny_websockets_lib/include -Iexternal/OpenThings-Framework-Firmware-Library/
LD=$(CXX)
LIBS=pthread mosquitto ssl crypto
LDFLAGS=$(addprefix -l,$(LIBS))
Expand Down
6 changes: 3 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ if [ "$1" == "demo" ]; then

ws=$(ls external/TinyWebsockets/tiny_websockets_lib/src/*.cpp)
otf=$(ls external/OpenThings-Framework-Firmware-Library/*.cpp)
g++ -o OpenSprinkler -DDEMO -DSMTP_OPENSSL $DEBUG -std=c++14 -include string.h main.cpp OpenSprinkler.cpp program.cpp opensprinkler_server.cpp utils.cpp weather.cpp gpio.cpp mqtt.cpp smtp.c -Iexternal/TinyWebsockets/tiny_websockets_lib/include $ws -Iexternal/OpenThings-Framework-Firmware-Library/ $otf -lpthread -lmosquitto -lssl -lcrypto
g++ -o OpenSprinkler -DDEMO -DSMTP_OPENSSL $DEBUG -std=c++14 -include string.h -include cstdint main.cpp OpenSprinkler.cpp program.cpp opensprinkler_server.cpp utils.cpp weather.cpp gpio.cpp mqtt.cpp smtp.c -Iexternal/TinyWebsockets/tiny_websockets_lib/include $ws -Iexternal/OpenThings-Framework-Firmware-Library/ $otf -lpthread -lmosquitto -lssl -lcrypto
elif [ "$1" == "osbo" ]; then
echo "Installing required libraries..."
apt-get install -y libmosquitto-dev libssl-dev
echo "Compiling osbo firmware..."

ws=$(ls external/TinyWebsockets/tiny_websockets_lib/src/*.cpp)
otf=$(ls external/OpenThings-Framework-Firmware-Library/*.cpp)
g++ -o OpenSprinkler -DOSBO -DSMTP_OPENSSL $DEBUG -std=c++14 -include string.h main.cpp OpenSprinkler.cpp program.cpp opensprinkler_server.cpp utils.cpp weather.cpp gpio.cpp mqtt.cpp smtp.c -Iexternal/TinyWebsockets/tiny_websockets_lib/include $ws -Iexternal/OpenThings-Framework-Firmware-Library/ $otf -lpthread -lmosquitto -lssl -lcrypto
g++ -o OpenSprinkler -DOSBO -DSMTP_OPENSSL $DEBUG -std=c++14 -include string.h -include cstdint main.cpp OpenSprinkler.cpp program.cpp opensprinkler_server.cpp utils.cpp weather.cpp gpio.cpp mqtt.cpp smtp.c -Iexternal/TinyWebsockets/tiny_websockets_lib/include $ws -Iexternal/OpenThings-Framework-Firmware-Library/ $otf -lpthread -lmosquitto -lssl -lcrypto
else
echo "Installing required libraries..."
apt-get update
Expand All @@ -66,7 +66,7 @@ else
echo "Compiling ospi firmware..."
ws=$(ls external/TinyWebsockets/tiny_websockets_lib/src/*.cpp)
otf=$(ls external/OpenThings-Framework-Firmware-Library/*.cpp)
g++ -o OpenSprinkler -DOSPI $USEGPIO -DSMTP_OPENSSL $DEBUG -std=c++14 -include string.h main.cpp OpenSprinkler.cpp program.cpp opensprinkler_server.cpp utils.cpp weather.cpp gpio.cpp mqtt.cpp smtp.c -Iexternal/TinyWebsockets/tiny_websockets_lib/include $ws -Iexternal/OpenThings-Framework-Firmware-Library/ $otf -lpthread -lmosquitto -lssl -lcrypto $GPIOLIB
g++ -o OpenSprinkler -DOSPI $USEGPIO -DSMTP_OPENSSL $DEBUG -std=c++14 -include string.h -include cstdint main.cpp OpenSprinkler.cpp program.cpp opensprinkler_server.cpp utils.cpp weather.cpp gpio.cpp mqtt.cpp smtp.c -Iexternal/TinyWebsockets/tiny_websockets_lib/include $ws -Iexternal/OpenThings-Framework-Firmware-Library/ $otf -lpthread -lmosquitto -lssl -lcrypto $GPIOLIB
fi

if [ -f /etc/init.d/OpenSprinkler.sh ]; then
Expand Down

0 comments on commit a22cad0

Please sign in to comment.