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

ld: library not found for -lhighgui #30

Open
ashgillman opened this issue Aug 20, 2015 · 2 comments
Open

ld: library not found for -lhighgui #30

ashgillman opened this issue Aug 20, 2015 · 2 comments

Comments

@ashgillman
Copy link

I had an error compiling on OSX Yosemite

Linking CXX executable flandmark_1
ld: library not found for -lhighgui
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [examples/flandmark_1] Error 1
make[2]: Target `examples/CMakeFiles/flandmark_1.dir/build' not remade because of errors.
make[1]: *** [examples/CMakeFiles/flandmark_1.dir/all] Error 2

I was able to fix by modifying /examples/CMakeLists.txt and commenting out lines 10 and 11.

if (UNIX)
#set(CV_LIBS_1 highgui)
#set(CV_LIBS_2 cxcore cv cvaux)
elseif (WIN32)
set(CV_LIBS_1 highgui${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH})
set(CV_LIBS_2 cxcore${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH} cv${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH} cvaux${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH})
elseif (APPLE)
endif (UNIX)

Although, this would probably break the installation on other systems. I believe there may be some issue preventing the installer from setting the UNIX variable false.

@uricamic
Copy link
Owner

Hi @ashgillman,

thank you for the info.

You are right, the CMakeLists.txt should be updated, because for OSX, UNIX is also set to true by CMake.

ashgillman added a commit to ashgillman/flandmark that referenced this issue Aug 21, 2015
In the examples CMakeLists.txt, explicit setting CV libs caused
compilation errors on OS X.
@burak43
Copy link

burak43 commented Jul 26, 2018

Same error on my Ubuntu 16.06 machine. I fixed the issue by modifying if statement in line 8 of the file /examples/CMakeLists.txt:

if (${OpenCV_VERSION_MINOR} **LESS** 3) to if (${OpenCV_VERSION_MINOR} **GREATER** 3), and of course corresponding endif statement in line 26. Both if (line 8) and else (line 17) statements were written for less than 3 case mistakenly and therefore, it enters into the if statement although my minor version is greater than 3. Need to fix this @uricamic.

burak43 added a commit to burak43/flandmark that referenced this issue Jul 26, 2018
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