Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
benoitguigal opened this issue Nov 26, 2014 · 3 comments
Closed

Comments

@benoitguigal
Copy link

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(useconds_t, 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@@GLIBC_2.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
Copy link

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

@condeDoug
Copy link

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
Copy link
Owner

thanks, I've updated the Makefile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants