scheckmedia / CameraControllerApi

The CameraControlerApi is an attempt to control a DSLR via REST functionality.
112 stars 24 forks source link

undefined reference to symbol 'pthread_getspecific@@GLIBC_2.4' #2

Closed benoitguigal closed 9 years ago

benoitguigal commented 9 years ago

Hello, when running "make" I get the error below: g++ -g -c -Wall -std=c++0x main.cpp -o main.o g++ -g -c -Wall -std=c++0x Api.cpp -o Api.o Api.cpp: In member function ‘bool CameraControllerApi::Api::get_settings_by_key(std::string, CameraControllerApi::CCA_API_OUTPUT_TYPE, std::string&)’: Api.cpp:70:41: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] g++ -g -c -Wall -std=c++0x Base64.cpp -o Base64.o g++ -g -c -Wall -std=c++0x CameraController.cpp -o CameraController.o CameraController.cpp: In member function ‘int CameraControllerApi::CameraController::_wait_and_handle_event(usecondst, CameraEventType, int)’: CameraController.cpp:528:18: warning: variable ‘path’ set but not used [-Wunused-but-set-variable] CameraController.cpp: In member function ‘void CameraControllerApi::CameraController::_set_capturetarget(int)’: CameraController.cpp:570:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] g++ -g -c -Wall -std=c++0x Command.cpp -o Command.o g++ -g -c -Wall -std=c++0x Helper.cpp -o Helper.o g++ -g -c -Wall -std=c++0x Server.cpp -o Server.o g++ -g -c -Wall -std=c++0x Settings.cpp -o Settings.o g++ -g -lboost_system -lgphoto2 -lmicrohttpd -lexif main.o Api.o Base64.o CameraController.o Command.o Helper.o Server.o Settings.o -o CameraControllerApi /usr/bin/ld: CameraController.o: undefined reference to symbol 'pthread_getspecific@@GLIBC2.4' //lib/arm-linux-gnueabihf/libpthread.so.0: error adding symbols: DSO missing from command line collect2: ld returned 1 exit status Makefile:11: recipe for target 'CameraControllerApi' failed make: ** [CameraControllerApi] Error 1

condeDoug commented 9 years ago

I'm having a similar issue. Did you find a solution?

condeDoug commented 9 years ago

I figured it out. Once you get to: g++ -g -lboost_system -lgphoto2 -lmicrohttpd -lexif main.o Api.o Base64.o CameraController.o Command.o Helper.o Server.o Settings.o -o CameraControllerApi

add: -lpthread

so use: g++ -g -lboost_system -lgphoto2 -lmicrohttpd -lexif -lpthread main.o Api.o Base64.o CameraController.o Command.o Helper.o Server.o Settings.o -o CameraControllerApi

scheckmedia commented 9 years ago

thanks, I've updated the Makefile