Исправлена ​​ошибка импорта библиотеки повышения в QT на ОС Ma c - PullRequest
0 голосов
/ 20 февраля 2020

У меня проблема с буст-библиотекой в ​​QT,

 ld: warning: directory not found for option '-L-L/usr/local/Cellar/boost/1.72.0/lib/'
Undefined symbols for architecture x86_64:
  "boost::filesystem::detail::dir_itr_close(void*&, void*&)", referenced from:
      GenvTracking::chargerModels() in genvtracking.o
      GenvTracking::chargerModels() (.cold.1) in genvtracking.o
  "boost::filesystem::detail::directory_iterator_construct(boost::filesystem::directory_iterator&, boost::filesystem::path const&, unsigned int, boost::system::error_code*)", referenced from:
      GenvTracking::chargerModels() in genvtracking.o
  "boost::filesystem::detail::directory_iterator_increment(boost::filesystem::directory_iterator&, boost::system::error_code*)", referenced from:
      GenvTracking::chargerModels() in genvtracking.o
  "boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)", referenced from:
      GenvTracking::chargerModels() in genvtracking.o
  "boost::filesystem::path::filename() const", referenced from:
      GenvTracking::chargerModels() in genvtracking.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [untitled2.app/Contents/MacOS/untitled2] Error 1
09:34:34: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project untitled2 (kit: Desktop Qt 5.12.5 clang 64bit)
When executing step "Make"
09:34:34: Elapsed time: 00:02.

my .pro file

INCLUDEPATH + = "/usr/local/Cellar/boost/1.72.0/include/" LIBPATH + = "- L / usr / local / Cellar / boost / 1.72.0 / lib / "

и моя функция:

void GenvTracking::chargerModels(){
    boost::filesystem::path p("..");
    for (auto i = boost::filesystem::directory_iterator(p); i != boost::filesystem::directory_iterator(); i++)
        {
            if (!is_directory(i->path()))
            {
                models.push_back(i->path().filename().string());
            }
            else
                continue;
        }
}

Я хочу использовать boost для положенных значений в векторе

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...