There must be something wrong with the copy of libjpeg installed on your
system. I have CMake setup to automatically find and link to the system
wide installed libjpeg or, if it can't be found, then it compiles the copy
of libjpeg included in dlib/external into your application. In your case,
CMake is finding it on your system and then linking to it but it doesn't
have the required link symbols.
If you comment out the line that says find_package(JPEG QUIET) in
dlib/CMakeLists.txt then CMake won't look on your system and will compile
its own copy of libjpeg. That's a little screwy though. The best thing to
do is to fix your system, which may be as simple as downloading libjpeg's
source and running a ./configure; make; make install to install it.
Cheers,
Davis
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm not sure what cmake is doing to search for it but it must have found a
copy somewhere on your system given the output you pasted. However, that
version of it is missing important symbols or is compiled in some
inappropriate way. I'm under the impression that mac supports both 32bit
and 64bit binaries on the same system. So maybe libjpeg is compiled as a
32bit library rather than as a 64bit library.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I just changed dlib's cmake file to check if the installed libjpeg contains the correct linker symbols and if not to compile it from scratch to make sure everything works. You can grab it from github (https://github.com/davisking/dlib/blob/master/dlib/CMakeLists.txt). This should hopefully sidestep any problems you are having.
Last edit: Davis 2014-12-30
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What is the output when you first generate the makefile with cmake? It
should say this somewhere in it:
-- Looking for png_create_read_struct
-- Looking for png_create_read_struct - found
-- Looking for jpeg_read_header
-- Looking for jpeg_read_header - found
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
-- Looking for png_create_read_struct
-- Looking for png_create_read_struct - found
-- Looking for jpeg_read_header
-- Looking for jpeg_read_header - found
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When following the example compilation instructions on dlib.net, I run into an error with a bunch of lines similar to this:
The complete compile log is here: https://gist.github.com/iandees/316df0bfd6733fc02607
Obviously I'm missing a JPEG library somewhere, but I don't know which one is needed or where it needs to go.
Thanks in advance!
Last edit: yellowbkpk 2014-12-28
There must be something wrong with the copy of libjpeg installed on your
system. I have CMake setup to automatically find and link to the system
wide installed libjpeg or, if it can't be found, then it compiles the copy
of libjpeg included in dlib/external into your application. In your case,
CMake is finding it on your system and then linking to it but it doesn't
have the required link symbols.
If you comment out the line that says find_package(JPEG QUIET) in
dlib/CMakeLists.txt then CMake won't look on your system and will compile
its own copy of libjpeg. That's a little screwy though. The best thing to
do is to fix your system, which may be as simple as downloading libjpeg's
source and running a ./configure; make; make install to install it.
Cheers,
Davis
Homebrew put jpeg-8d at
/usr/local/Cellar/jpeg/8d/lib/:What is cmake doing to search for it? Can I tell it where the library is?
I'm not sure what cmake is doing to search for it but it must have found a
copy somewhere on your system given the output you pasted. However, that
version of it is missing important symbols or is compiled in some
inappropriate way. I'm under the impression that mac supports both 32bit
and 64bit binaries on the same system. So maybe libjpeg is compiled as a
32bit library rather than as a 64bit library.
I just changed dlib's cmake file to check if the installed libjpeg contains the correct linker symbols and if not to compile it from scratch to make sure everything works. You can grab it from github (https://github.com/davisking/dlib/blob/master/dlib/CMakeLists.txt). This should hopefully sidestep any problems you are having.
Last edit: Davis 2014-12-30
I cloned from Github and am getting the same error:
What is the output when you first generate the makefile with cmake? It
should say this somewhere in it:
-- Looking for png_create_read_struct
-- Looking for png_create_read_struct - found
-- Looking for jpeg_read_header
-- Looking for jpeg_read_header - found
Yep, got this:
lol, naturally. I don't what what the deal is with the new OS X. If you
replace line 277 in dlib/CMakeLists.txt
with
it should definitely compile since that avoids linking to the system's
libjpeg all together. So does that work?
That worked, thanks! Now I need to figure out how to train my sign detector...
Cool. I'll commit that change.