Openpose: libopenpose.so.1.2.1: undefined reference to `gluPerspective'

Created on 18 Feb 2018  路  3Comments  路  Source: CMU-Perceptual-Computing-Lab/openpose

Issue Summary

Getting compilation error while compiling with 3D renderer

[ 92%] Linking CXX executable openpose.bin
../../src/openpose/libopenpose.so.1.2.1: undefined reference to `gluPerspective'
../../src/openpose/libopenpose.so.1.2.1: undefined reference to `gluLookAt'
collect2: error: ld returned 1 exit status
examples/openpose/CMakeFiles/openpose.bin.dir/build.make:155: recipe for target 'examples/openpose/openpose.bin' failed
make[2]: *** [examples/openpose/openpose.bin] Error 1
CMakeFiles/Makefile2:1077: recipe for target 'examples/openpose/CMakeFiles/openpose.bin.dir/all' failed
make[1]: *** [examples/openpose/CMakeFiles/openpose.bin.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Might be related with: https://stackoverflow.com/a/14793491

Type of Issue

You might select multiple topics, delete the rest:

  • Compilation/installation error

Your System Configuration

Operating system (lsb_release -a in Ubuntu): Ubuntu 16.04.3 LTS
Installation mode: CMake
CUDA version (cat /usr/local/cuda/version.txt in most cases): 8.0
cuDNN version: 5
Release or Debug mode? (by defualt: release): release
3-D Reconstruction module added? (by default: no): yes
GPU model (nvidia-smi in Ubuntu): GeForce GTX 1070
Caffe version: Default from OpenPose,
OpenCV version: opencv 3.1 installed from github repository
Compiler (gcc --version in Ubuntu): 5.4.0

stalold

Most helpful comment

I had this same issue and already had freeglut installed. I also don't think rebooting the computer would help (since the ld should be updated after the apt-get). I also did that but just saying.

In this case, I found that -lGLU was not being added to the compiler call so I added it to the glut compiler line in the CMakeLists.txt file here (Line 830 at the moment):
if (WITH_3D_RENDERER)
set(OpenPose_3rdparty_libraries ${OpenPose_3rdparty_libraries} ${GLUT_LIBRARY} -lGLU)
endif (WITH_3D_RENDERER)

This fixed the issue and allowed it to compile.

All 3 comments

Could you try: sudo apt-get update && sudo apt-get install build-essential freeglut3 freeglut3-dev libxmu-dev libxi-dev and reboot your PC?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

I had this same issue and already had freeglut installed. I also don't think rebooting the computer would help (since the ld should be updated after the apt-get). I also did that but just saying.

In this case, I found that -lGLU was not being added to the compiler call so I added it to the glut compiler line in the CMakeLists.txt file here (Line 830 at the moment):
if (WITH_3D_RENDERER)
set(OpenPose_3rdparty_libraries ${OpenPose_3rdparty_libraries} ${GLUT_LIBRARY} -lGLU)
endif (WITH_3D_RENDERER)

This fixed the issue and allowed it to compile.

Was this page helpful?
0 / 5 - 0 ratings