diff --git a/Makefile b/Makefile index 9e24b70cd..d46406461 100644 --- a/Makefile +++ b/Makefile @@ -2,8 +2,8 @@ CC = gcc CXX = g++ -CFLAGS = -g -O3 -Wall -std=c++0x -LIBS = +CFLAGS = -g -O3 -Wall -std=c++0x -pthread +LIBS = -lpthread LDFLAGS = -g OBJECTS = \ diff --git a/Makefile.Pi.Adafruit b/Makefile.Pi.Adafruit index e929fb6d4..7e5a9a53e 100644 --- a/Makefile.Pi.Adafruit +++ b/Makefile.Pi.Adafruit @@ -2,7 +2,7 @@ # Support for the Adafruit i2c 16 x 2 RGB LCD Pi Plate CC = gcc CXX = g++ -CFLAGS = -g -O3 -Wall -std=c++0x -DHD44780 -DADAFRUIT_DISPLAY -I/usr/local/include +CFLAGS = -g -O3 -Wall -std=c++0x -pthread -DHD44780 -DADAFRUIT_DISPLAY -I/usr/local/include LIBS = -lwiringPi -lwiringPiDev -lpthread LDFLAGS = -g -L/usr/local/lib diff --git a/Makefile.Pi.HD44780 b/Makefile.Pi.HD44780 index 9294eade3..e44d60699 100644 --- a/Makefile.Pi.HD44780 +++ b/Makefile.Pi.HD44780 @@ -2,7 +2,7 @@ CC = gcc CXX = g++ -CFLAGS = -g -O3 -Wall -std=c++0x -DHD44780 -I/usr/local/include +CFLAGS = -g -O3 -Wall -std=c++0x -pthread -DHD44780 -I/usr/local/include LIBS = -lwiringPi -lwiringPiDev -lpthread LDFLAGS = -g -L/usr/local/lib diff --git a/Makefile.Pi.OLED b/Makefile.Pi.OLED index 95298f7f8..7af4bed03 100644 --- a/Makefile.Pi.OLED +++ b/Makefile.Pi.OLED @@ -2,8 +2,8 @@ CC = gcc CXX = g++ -CFLAGS = -g -O3 -Wall -std=c++0x -DOLED -I/usr/local/include -LIBS = -lArduiPi_OLED +CFLAGS = -g -O3 -Wall -std=c++0x -pthread -DOLED -I/usr/local/include +LIBS = -lArduiPi_OLED -lpthread LDFLAGS = -g -L/usr/local/lib OBJECTS = \ diff --git a/Thread.cpp b/Thread.cpp index 9f43374ef..b3344362b 100644 --- a/Thread.cpp +++ b/Thread.cpp @@ -61,6 +61,8 @@ void CThread::sleep(unsigned int ms) #else +#include + CThread::CThread() : m_thread() { diff --git a/Thread.h b/Thread.h index 8a6843fd2..352d9383f 100644 --- a/Thread.h +++ b/Thread.h @@ -41,7 +41,7 @@ class CThread private: #if defined(_WIN32) || defined(_WIN64) - HANDLE m_handle; + HANDLE m_handle; #else pthread_t m_thread; #endif