Compilation errors with C++


#1

Hello All,

I am trying to create a basic Frame based Emotion Detection on Ubuntu 16.04 using C++ SDK. I have OpenCV 2.4.13 (could not find 2.4.8). I have g++ compiler with 5.4 version.

I have followed the tutorial video provided on the Developer Guide.

I run command:
g++ main.cpp -o main -l affdex-native -std=c++11 -I$AFFDEX_HOME/affdex-sdk/include -L$AFFDEX_HOME/affdex-sdk/lib 'Magick++-config --cppflags --cxxflags --ldflags --libs'

I am facing below errors:
undefined reference to 'affdex::Detector::setClassifierPath(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' collect2: error: ld returned 1 exit status

This code was done using PhotoDetector however, in the end, I need it to be done using FrameDetector.

Kindly guide me through the correct path.

Thanks,
Mudra


#2

The current Linux SDK does not have support for gcc-5.4, I am sorry you will have to downgrade to gcc-4.8. Please find more comments on this on https://github.com/Affectiva/cpp-sdk-samples/issues/15. You can refer to the same repository for an example on how to work with FrameDetector.


#3

Thank you @umang_mehta.

I tried using the gcc-4.8 version but I received similar errors for Magick library.
undefined reference to 'Magick::Image::Image(std::string const&)' undefined reference to 'Magick::Image::write(int, int, unsigned int, unsigned int, std::string const&, MagickLib::StorageType, void*)'

I thought gcc-5.4 at least works with Magick++. I have below libs installed on ubuntu for Magick++.
libmagick+±6.q16-dev - object-oriented C++ interface to ImageMagick - development files
libmagick+±dev - object-oriented C++ interface to ImageMagick
libmagickcore-6.q16-dev - low-level image manipulation library - development files (Q16)
libmagickcore-dev - low-level image manipulation library – transition package
libmagickwand-6.q16-dev - image manipulation library - development files
libmagickwand-dev - image manipulation library - transition for development files
graphicsmagick-libmagick-dev-compat - image processing libraries providing ImageMagick interface
libgraphicsmagick++1-dev - format-independent image processing - C++ development files
libgraphicsmagick1-dev - format-independent image processing - C development files

Finally, I have Ubuntu 16.04, gcc 4.8, opencv 2.4.13, boost 1.58 using apt-get and 1.59 manually installed. Let me know if any of this can create any issues.

The link for demo of FrameDetector class in the Github repository ReadMe does not work. Here is the link, http://developer.affectiva.com/v3_2/cpp/analyze-frames/

I then copied the opencv-webcam-demo.cpp file to check if that gets compiled but no luck and faces another set of errors.
In file included from /home/mudra/Documents/affdex-sdk/affdex-sdk/include/Frame.h:4:0,
from opencv_webcam_sample_git.cpp:10:
/home/mudra/Documents/affdex-sdk/affdex-sdk/include/typedefs.h:3:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
#pragma warning(push, 0)
^
In file included from /home/mudra/Documents/affdex-sdk/affdex-sdk/include/Frame.h:4:0,
from opencv_webcam_sample_git.cpp:10:
/home/mudra/Documents/affdex-sdk/affdex-sdk/include/typedefs.h:8:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
#pragma warning(pop)
^
In file included from opencv_webcam_sample_git.cpp:10:0:
/home/mudra/Documents/affdex-sdk/affdex-sdk/include/Frame.h:6:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
#pragma warning(push, 0)
^
/home/mudra/Documents/affdex-sdk/affdex-sdk/include/Frame.h:10:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
#pragma warning(pop)
^
In file included from opencv_webcam_sample_git.cpp:11:0:
/home/mudra/Documents/affdex-sdk/affdex-sdk/include/Face.h:2:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
#pragma warning( disable : 4505 )
^
/home/mudra/Documents/affdex-sdk/affdex-sdk/include/Face.h:4:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
#pragma warning(push, 0)
^
In file included from opencv_webcam_sample_git.cpp:11:0:
/home/mudra/Documents/affdex-sdk/affdex-sdk/include/Face.h:9:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
#pragma warning(pop)
^
In file included from opencv_webcam_sample_git.cpp:12:0:
/home/mudra/Documents/affdex-sdk/affdex-sdk/include/FrameDetector.h:3:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
#pragma warning(push, 0)
^
/home/mudra/Documents/affdex-sdk/affdex-sdk/include/FrameDetector.h:5:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
#pragma warning(pop)
^
In file included from /home/mudra/Documents/affdex-sdk/affdex-sdk/include/FrameDetector.h:7:0,
from opencv_webcam_sample_git.cpp:12:
/home/mudra/Documents/affdex-sdk/affdex-sdk/include/Detector.h:2:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
#pragma warning( disable : 4996 )
^
/home/mudra/Documents/affdex-sdk/affdex-sdk/include/Detector.h:3:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
#pragma warning(push, 0)
^
/home/mudra/Documents/affdex-sdk/affdex-sdk/include/Detector.h:6:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
#pragma warning(pop)
^
In file included from /home/mudra/Documents/affdex-sdk/affdex-sdk/include/Detector.h:9:0,
from /home/mudra/Documents/affdex-sdk/affdex-sdk/include/FrameDetector.h:7,
from opencv_webcam_sample_git.cpp:12:
/home/mudra/Documents/affdex-sdk/affdex-sdk/include/ImageListener.h:3:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
#pragma warning(push, 0)
^
/home/mudra/Documents/affdex-sdk/affdex-sdk/include/ImageListener.h:6:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
#pragma warning(pop)
^
In file included from /home/mudra/Documents/affdex-sdk/affdex-sdk/include/ProcessStatusListener.h:3:0,
from /home/mudra/Documents/affdex-sdk/affdex-sdk/include/Detector.h:11,
from /home/mudra/Documents/affdex-sdk/affdex-sdk/include/FrameDetector.h:7,
from opencv_webcam_sample_git.cpp:12:
/home/mudra/Documents/affdex-sdk/affdex-sdk/include/AffdexException.h:3:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
#pragma warning(push, 0)
^
/home/mudra/Documents/affdex-sdk/affdex-sdk/include/AffdexException.h:6:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
#pragma warning(pop)
^
In file included from opencv_webcam_sample_git.cpp:16:0:
PlottingImageListener.hpp: In constructor ‘PlottingImageListener::PlottingImageListener(std::ofstream&, bool)’:
PlottingImageListener.hpp:37:16: warning: ‘PlottingImageListener::mDrawDisplay’ will be initialized after [-Wreorder]
const bool mDrawDisplay;
^
PlottingImageListener.hpp:36:56: warning: ‘std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long int, std::ratio<1l, 1000000000l> > > PlottingImageListener::mStartT’ [-Wreorder]
std::chrono::time_pointstd::chrono::system_clock mStartT;
^
PlottingImageListener.hpp:55:5: warning: when initialized here [-Wreorder]
PlottingImageListener(std::ofstream &csv, const bool draw_display)
^
PlottingImageListener.hpp:36:56: warning: ‘PlottingImageListener::mStartT’ will be initialized after [-Wreorder]
std::chrono::time_pointstd::chrono::system_clock mStartT;
^
PlottingImageListener.hpp:31:12: warning: ‘double PlottingImageListener::mCaptureLastTS’ [-Wreorder]
double mCaptureLastTS;
^
PlottingImageListener.hpp:55:5: warning: when initialized here [-Wreorder]
PlottingImageListener(std::ofstream &csv, const bool draw_display)
^
opencv_webcam_sample_git.cpp: In function ‘int main(int, char**)’:
opencv_webcam_sample_git.cpp:48:15: warning: variable ‘capture_fps’ set but not used [-Wunused-but-set-variable]
float capture_fps = -1.0f;
^
/tmp/cc8pGSfB.o: In function boost::program_options::typed_value<std::string, char>::xparse(boost::any&, std::vector<std::string, std::allocator<std::string> > const&) const': /usr/include/boost/program_options/detail/value_semantic.hpp:167: undefined reference toboost::program_options::validate(boost::any&, std::vector<std::string, std::allocatorstd::string > const&, std::string*, int)’
/tmp/cc8pGSfB.o: In function boost::program_options::typed_value<bool, char>::xparse(boost::any&, std::vector<std::string, std::allocator<std::string> > const&) const': /usr/include/boost/program_options/detail/value_semantic.hpp:167: undefined reference toboost::program_options::validate(boost::any&, std::vector<std::string, std::allocatorstd::string > const&, bool*, int)’
/tmp/cc8pGSfB.o: In function boost::program_options::validation_error::validation_error(boost::program_options::validation_error::kind_t, std::string const&, std::string const&, int)': /usr/include/boost/program_options/errors.hpp:373: undefined reference toboost::program_options::validation_error::get_template(boost::program_options::validation_error::kind_t)’
/usr/include/boost/program_options/errors.hpp:373: undefined reference to boost::program_options::error_with_option_name::error_with_option_name(std::string const&, std::string const&, std::string const&, int)' /tmp/cc8pGSfB.o: In functionboost::program_options::error_with_option_name::~error_with_option_name()’:
/usr/include/boost/program_options/errors.hpp:119: undefined reference to vtable for boost::program_options::error_with_option_name' /tmp/cc8pGSfB.o: In function~error_with_option_name’:
/usr/include/boost/program_options/errors.hpp:119: undefined reference to vtable for boost::program_options::error_with_option_name' /usr/include/boost/program_options/errors.hpp:119: undefined reference tovtable for boost::program_options::error_with_option_name’
/usr/include/boost/program_options/errors.hpp:119: undefined reference to vtable for boost::program_options::error_with_option_name' /usr/include/boost/program_options/errors.hpp:119: undefined reference tovtable for boost::program_options::error_with_option_name’
/tmp/cc8pGSfB.o:/usr/include/boost/program_options/errors.hpp:119: more undefined references to vtable for boost::program_options::error_with_option_name' follow /tmp/cc8pGSfB.o: In functionPlottingImageListener::draw(std::map<int, affdex::Face, std::less, std::allocator<std::pair<int const, affdex::Face> > >, affdex::Frame)’:
/home/mudra/Documents/affdex-sdk/PlottingImageListener.hpp:336: undefined reference to cv::imshow(std::string const&, cv::_InputArray const&)' /home/mudra/Documents/affdex-sdk/PlottingImageListener.hpp:338: undefined reference tocv::waitKey(int)’
/tmp/cc8pGSfB.o: In function to_internal<std::basic_string<char> >': /usr/include/boost/program_options/detail/convert.hpp:79: undefined reference toboost::program_options::to_internal(std::string const&)’
/tmp/cc8pGSfB.o: In function boost::program_options::basic_command_line_parser<char>::basic_command_line_parser(int, char const* const*)': /usr/include/boost/program_options/detail/parsers.hpp:43: undefined reference toboost::program_options::detail::cmdline::cmdline(std::vector<std::string, std::allocatorstd::string > const&)’
/tmp/cc8pGSfB.o: In function boost::program_options::basic_command_line_parser<char>::run()': /usr/include/boost/program_options/detail/parsers.hpp:107: undefined reference toboost::program_options::detail::cmdline::get_canonical_option_prefix()’
/usr/include/boost/program_options/detail/parsers.hpp:108: undefined reference to boost::program_options::detail::cmdline::run()' /tmp/cc8pGSfB.o: In functionboost::program_options::typed_value<unsigned int, char>::name() const’:
/usr/include/boost/program_options/detail/value_semantic.hpp:19: undefined reference to boost::program_options::arg' /tmp/cc8pGSfB.o: In functionboost::program_options::typed_value<int, char>::name() const’:
/usr/include/boost/program_options/detail/value_semantic.hpp:19: undefined reference to boost::program_options::arg' /tmp/cc8pGSfB.o: In functionboost::program_options::typed_value<std::vector<int, std::allocator >, char>::name() const’:
/usr/include/boost/program_options/detail/value_semantic.hpp:19: undefined reference to boost::program_options::arg' /tmp/cc8pGSfB.o: In functionboost::program_options::typed_value<std::string, char>::name() const’:
/usr/include/boost/program_options/detail/value_semantic.hpp:19: undefined reference to boost::program_options::arg' /tmp/cc8pGSfB.o: In functionboost::program_options::typed_value<bool, char>::name() const’:
/usr/include/boost/program_options/detail/value_semantic.hpp:19: undefined reference to boost::program_options::arg' /tmp/cc8pGSfB.o: In functionboost::program_options::variables_map::~variables_map()’:
/usr/include/boost/program_options/variables_map.hpp:146: undefined reference to vtable for boost::program_options::variables_map' /tmp/cc8pGSfB.o: In function~variables_map’:
/usr/include/boost/program_options/variables_map.hpp:146: undefined reference to vtable for boost::program_options::variables_map' /tmp/cc8pGSfB.o: In functionboost::program_options::error_with_option_name::error_with_option_name(boost::program_options::error_with_option_name const&)’:
/usr/include/boost/program_options/errors.hpp:89: undefined reference to vtable for boost::program_options::error_with_option_name' /tmp/cc8pGSfB.o: In functionvoid boost::program_options::validate<unsigned int, char>(boost::any&, std::vector<std::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::basic_string<char, std::char_traits, std::allocator > > > const&, unsigned int*, long)’:
/usr/include/boost/program_options/detail/value_semantic.hpp:86: undefined reference to boost::program_options::validators::check_first_occurrence(boost::any const&)' /usr/include/boost/program_options/detail/value_semantic.hpp:92: undefined reference toboost::program_options::invalid_option_value::invalid_option_value(std::string const&)’
/tmp/cc8pGSfB.o: In function void boost::program_options::validate<int, char>(boost::any&, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, int*, long)': /usr/include/boost/program_options/detail/value_semantic.hpp:86: undefined reference toboost::program_options::validators::check_first_occurrence(boost::any const&)’
/usr/include/boost/program_options/detail/value_semantic.hpp:92: undefined reference to boost::program_options::invalid_option_value::invalid_option_value(std::string const&)' /tmp/cc8pGSfB.o: In functionvoid boost::program_options::validate<int, char>(boost::any&, std::vector<std::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::basic_string<char, std::char_traits, std::allocator > > > const&, std::vector<int, std::allocator >, int)’:
/usr/include/boost/program_options/detail/value_semantic.hpp:150: undefined reference to boost::program_options::invalid_option_value::invalid_option_value(std::string const&)' /tmp/cc8pGSfB.o: In functionmain’:
/home/mudra/Documents/affdex-sdk/opencv_webcam_sample_git.cpp:54: undefined reference to boost::program_options::options_description::m_default_line_length' /home/mudra/Documents/affdex-sdk/opencv_webcam_sample_git.cpp:54: undefined reference toboost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)’
/home/mudra/Documents/affdex-sdk/opencv_webcam_sample_git.cpp:56: undefined reference to boost::program_options::bool_switch()' /home/mudra/Documents/affdex-sdk/opencv_webcam_sample_git.cpp:56: undefined reference toboost::program_options::options_description::add_options()’
/home/mudra/Documents/affdex-sdk/opencv_webcam_sample_git.cpp:56: undefined reference to boost::program_options::options_description_easy_init::operator()(char const*, boost::program_options::value_semantic const*, char const*)' /home/mudra/Documents/affdex-sdk/opencv_webcam_sample_git.cpp:60: undefined reference toboost::program_options::options_description_easy_init::operator()(char const
, boost::program_options::value_semantic const*, char const*)’
/home/mudra/Documents/affdex-sdk/opencv_webcam_sample_git.cpp:62: undefined reference to boost::program_options::options_description_easy_init::operator()(char const*, boost::program_options::value_semantic const*, char const*)' /home/mudra/Documents/affdex-sdk/opencv_webcam_sample_git.cpp:63: undefined reference toboost::program_options::options_description_easy_init::operator()(char const*, boost::program_options::value_semantic const*, char const*)’
/home/mudra/Documents/affdex-sdk/opencv_webcam_sample_git.cpp:64: undefined reference to boost::program_options::options_description_easy_init::operator()(char const*, boost::program_options::value_semantic const*, char const*)' /tmp/cc8pGSfB.o:/home/mudra/Documents/affdex-sdk/opencv_webcam_sample_git.cpp:65: more undefined references toboost::program_options::options_description_easy_init::operator()(char const*, boost::program_options::value_semantic const*, char const*)’ follow
/tmp/cc8pGSfB.o: In function main': /home/mudra/Documents/affdex-sdk/opencv_webcam_sample_git.cpp:71: undefined reference toboost::program_options::variables_map::variables_map()’
/tmp/cc8pGSfB.o: In function boost::program_options::basic_command_line_parser<char>::options(boost::program_options::options_description const&)': /usr/include/boost/program_options/detail/parsers.hpp:51: undefined reference toboost::program_options::detail::cmdline::set_options_description(boost::program_options::options_description const&)’
/tmp/cc8pGSfB.o: In function main': /home/mudra/Documents/affdex-sdk/opencv_webcam_sample_git.cpp:74: undefined reference toboost::program_options::store(boost::program_options::basic_parsed_options const&, boost::program_options::variables_map&, bool)’
/tmp/cc8pGSfB.o: In function boost::program_options::variables_map::operator[](std::string const&) const': /usr/include/boost/program_options/variables_map.hpp:155: undefined reference toboost::program_options::abstract_variables_map::operator[](std::string const&) const’
/tmp/cc8pGSfB.o: In function main': /home/mudra/Documents/affdex-sdk/opencv_webcam_sample_git.cpp:77: undefined reference toboost::program_options::operator<<(std::ostream&, boost::program_options::options_description const&)’
/home/mudra/Documents/affdex-sdk/opencv_webcam_sample_git.cpp:80: undefined reference to boost::program_options::notify(boost::program_options::variables_map&)' /home/mudra/Documents/affdex-sdk/opencv_webcam_sample_git.cpp:93: undefined reference toboost::program_options::operator<<(std::ostream&, boost::program_options::options_description const&)’
/tmp/cc8pGSfB.o:(.rodata._ZTVN5boost16exception_detail19error_info_injectorINS_15program_options20invalid_option_valueEEE[_ZTVN5boost16exception_detail19error_info_injectorINS_15program_options20invalid_option_valueEEE]+0x20): undefined reference to boost::program_options::error_with_option_name::what() const' /tmp/cc8pGSfB.o:(.rodata._ZTVN5boost16exception_detail19error_info_injectorINS_15program_options20invalid_option_valueEEE[_ZTVN5boost16exception_detail19error_info_injectorINS_15program_options20invalid_option_valueEEE]+0x30): undefined reference toboost::program_options::error_with_option_name::substitute_placeholders(std::string const&) const’
/tmp/cc8pGSfB.o:(.rodata._ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options20invalid_option_valueEEEEE[_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options20invalid_option_valueEEEEE]+0x28): undefined reference to boost::program_options::error_with_option_name::what() const' /tmp/cc8pGSfB.o:(.rodata._ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options20invalid_option_valueEEEEE[_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options20invalid_option_valueEEEEE]+0x38): undefined reference toboost::program_options::error_with_option_name::substitute_placeholders(std::string const&) const’
/tmp/cc8pGSfB.o:(.rodata._ZTVN5boost16exception_detail19error_info_injectorINS_15program_options16validation_errorEEE[_ZTVN5boost16exception_detail19error_info_injectorINS_15program_options16validation_errorEEE]+0x20): undefined reference to boost::program_options::error_with_option_name::what() const' /tmp/cc8pGSfB.o:(.rodata._ZTVN5boost16exception_detail19error_info_injectorINS_15program_options16validation_errorEEE[_ZTVN5boost16exception_detail19error_info_injectorINS_15program_options16validation_errorEEE]+0x30): undefined reference toboost::program_options::error_with_option_name::substitute_placeholders(std::string const&) const’
/tmp/cc8pGSfB.o:(.rodata._ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options16validation_errorEEEEE[_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options16validation_errorEEEEE]+0x28): undefined reference to boost::program_options::error_with_option_name::what() const' /tmp/cc8pGSfB.o:(.rodata._ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options16validation_errorEEEEE[_ZTVN5boost16exception_detail10clone_implINS0_19error_info_injectorINS_15program_options16validation_errorEEEEE]+0x38): undefined reference toboost::program_options::error_with_option_name::substitute_placeholders(std::string const&) const’
/tmp/cc8pGSfB.o:(.rodata._ZTIN5boost15program_options16validation_errorE[_ZTIN5boost15program_options16validation_errorE]+0x10): undefined reference to typeinfo for boost::program_options::error_with_option_name' /tmp/cc8pGSfB.o:(.rodata._ZTIN5boost15program_options11typed_valueIbcEE[_ZTIN5boost15program_options11typed_valueIbcEE]+0x18): undefined reference totypeinfo for boost::program_options::value_semantic_codecvt_helper’
/tmp/cc8pGSfB.o:(.rodata._ZTIN5boost15program_options11typed_valueISscEE[_ZTIN5boost15program_options11typed_valueISscEE]+0x18): undefined reference to typeinfo for boost::program_options::value_semantic_codecvt_helper<char>' /tmp/cc8pGSfB.o:(.rodata._ZTIN5boost15program_options11typed_valueISt6vectorIiSaIiEEcEE[_ZTIN5boost15program_options11typed_valueISt6vectorIiSaIiEEcEE]+0x18): undefined reference totypeinfo for boost::program_options::value_semantic_codecvt_helper’
/tmp/cc8pGSfB.o:(.rodata._ZTIN5boost15program_options11typed_valueIicEE[_ZTIN5boost15program_options11typed_valueIicEE]+0x18): undefined reference to typeinfo for boost::program_options::value_semantic_codecvt_helper<char>' /tmp/cc8pGSfB.o:(.rodata._ZTIN5boost15program_options11typed_valueIjcEE[_ZTIN5boost15program_options11typed_valueIjcEE]+0x18): undefined reference totypeinfo for boost::program_options::value_semantic_codecvt_helper’
/tmp/cc8pGSfB.o:(.rodata._ZTVN5boost15program_options16validation_errorE[_ZTVN5boost15program_options16validation_errorE]+0x20): undefined reference to boost::program_options::error_with_option_name::what() const' /tmp/cc8pGSfB.o:(.rodata._ZTVN5boost15program_options16validation_errorE[_ZTVN5boost15program_options16validation_errorE]+0x30): undefined reference toboost::program_options::error_with_option_name::substitute_placeholders(std::string const&) const’
/tmp/cc8pGSfB.o:(.rodata._ZTVN5boost15program_options20invalid_option_valueE[_ZTVN5boost15program_options20invalid_option_valueE]+0x20): undefined reference to boost::program_options::error_with_option_name::what() const' /tmp/cc8pGSfB.o:(.rodata._ZTVN5boost15program_options20invalid_option_valueE[_ZTVN5boost15program_options20invalid_option_valueE]+0x30): undefined reference toboost::program_options::error_with_option_name::substitute_placeholders(std::string const&) const’
/tmp/cc8pGSfB.o:(.rodata._ZTVN5boost15program_options11typed_valueIbcEE[_ZTVN5boost15program_options11typed_valueIbcEE]+0x38): undefined reference to boost::program_options::value_semantic_codecvt_helper<char>::parse(boost::any&, std::vector<std::string, std::allocator<std::string> > const&, bool) const' /tmp/cc8pGSfB.o:(.rodata._ZTVN5boost15program_options11typed_valueISscEE[_ZTVN5boost15program_options11typed_valueISscEE]+0x38): undefined reference toboost::program_options::value_semantic_codecvt_helper::parse(boost::any&, std::vector<std::string, std::allocatorstd::string > const&, bool) const’
/tmp/cc8pGSfB.o:(.rodata._ZTVN5boost15program_options11typed_valueISt6vectorIiSaIiEEcEE[_ZTVN5boost15program_options11typed_valueISt6vectorIiSaIiEEcEE]+0x38): undefined reference to boost::program_options::value_semantic_codecvt_helper<char>::parse(boost::any&, std::vector<std::string, std::allocator<std::string> > const&, bool) const' /tmp/cc8pGSfB.o:(.rodata._ZTVN5boost15program_options11typed_valueIicEE[_ZTVN5boost15program_options11typed_valueIicEE]+0x38): undefined reference toboost::program_options::value_semantic_codecvt_helper::parse(boost::any&, std::vector<std::string, std::allocatorstd::string > const&, bool) const’
/tmp/cc8pGSfB.o:(.rodata._ZTVN5boost15program_options11typed_valueIjcEE[_ZTVN5boost15program_options11typed_valueIjcEE]+0x38): undefined reference to `boost::program_options::value_semantic_codecvt_helper::parse(boost::any&, std::vector<std::string, std::allocatorstd::string > const&, bool) const’
collect2: error: ld returned 1 exit status

Am I missing something trivial? I have downloaded the Ubuntu version of affdex from site and thus, have not cmake the demo files.


#4

to silence those warnings about “#pragma warning” you could compile with -Wno-unknown-pragmas.

Other than that, it looks like you’re getting a bunch of undefined references due to the fact that you’re compiling opencv_webcam_sample_git.cpp, which uses Boost’s program options library, but I’m guessing that you’re not including that library in your build.


#5

Yes, boost version was the issue. I could not make the boost libraries visible for the compiler somehow.

I changed my OS to 14.04 and boost lib to 1.55. It worked ! Thanks for the support @umang_mehta and @andy_dennie.

Cheers :slight_smile:


#6