如何在构建Dlib代码时解决编译错误。

时间:2015-01-06 08:54:05

标签: c++ image-processing mingw

我尝试使用MinGW和Netbeans运行示例Dlib代码。但是我遇到了编译错误。

遵循的步骤:

1.从Dlib网站下载Dlib包。

2.在c ++编译器设置中包含根文件夹(Dlib),并在编译器附加标志中设置-std = c ++ 11。

3.从Dlib文件夹示例中复制样本。

4.Compiled。

编译代码时出现Bellow错误。给我执行Dlib示例代码的简单步骤(例如Dlib中的示例中的face_detection_ex代码)

build/Debug/MinGW-Windows/main.o: In function `Z12loadIbugDataN5boost10filesystem4pathE':
D:\NetBeansProjects\SDM/main.cpp:124: undefined reference to `boost::filesystem::path::extension() const'
D:\NetBeansProjects\SDM/main.cpp:133: undefined reference to `boost::filesystem::path::replace_extension(boost::filesystem::path const&)'
build/Debug/MinGW-Windows/main.o: In function `main':
D:\NetBeansProjects\SDM/main.cpp:355: undefined reference to `boost::program_options::options_description::m_default_line_length'
D:\NetBeansProjects\SDM/main.cpp:355: undefined reference to `boost::program_options::options_description::m_default_line_length'
D:\NetBeansProjects\SDM/main.cpp:355: undefined reference to `boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)'
D:\NetBeansProjects\SDM/main.cpp:358: undefined reference to `boost::program_options::options_description::add_options()'
D:\NetBeansProjects\SDM/main.cpp:358: undefined reference to `boost::program_options::options_description_easy_init::operator()(char const*, char const*)'
D:\NetBeansProjects\SDM/main.cpp:360: undefined reference to `boost::program_options::options_description_easy_init::operator()(char const*, boost::program_options::value_semantic const*, char const*)'
D:\NetBeansProjects\SDM/main.cpp:362: undefined reference to `boost::program_options::options_description_easy_init::operator()(char const*, boost::program_options::value_semantic const*, char const*)'
D:\NetBeansProjects\SDM/main.cpp:365: undefined reference to `boost::program_options::options_description_easy_init::operator()(char const*, boost::program_options::value_semantic const*, char const*)'
D:\NetBeansProjects\SDM/main.cpp:366: undefined reference to `boost::program_options::variables_map::variables_map()'
D:\NetBeansProjects\SDM/main.cpp:367: undefined reference to `boost::program_options::store(boost::program_options::basic_parsed_options<char> const&, boost::program_options::variables_map&, bool)'
D:\NetBeansProjects\SDM/main.cpp:370: undefined reference to `boost::program_options::operator<<(std::ostream&, boost::program_options::options_description const&)'
D:\NetBeansProjects\SDM/main.cpp:373: undefined reference to `boost::program_options::notify(boost::program_options::variables_map&)'

1 个答案:

答案 0 :(得分:0)

如果您使用的是Linux您需要将libvl.so添加到链接器设置中。 在64位系统中,您可以在/ vlfeat / bin / glnxa64 /中找到此文件。