p-ranav / fccf

fccf: A command-line tool that quickly searches through C/C++ source code in a directory based on a search string and prints relevant code snippets that match the query.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compile on Ubuntu 18.04 has a problem

arihantb2 opened this issue · comments

I am getting this build error when running the cmake --build build command. The error is below,

<path>/fccf/source/searcher.cpp: In static member function ‘static void search::searcher::file_search(std::string_view, std::string_view)’:
<path>/fccf/source/searcher.cpp:88:15: error: ‘CXTranslationUnit_IgnoreNonErrorsFromIncludedFiles’ was not declared in this scope
   88 |             | CXTranslationUnit_IgnoreNonErrorsFromIncludedFiles);
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Build settings,

-- The CXX compiler identification is GNU 9.4.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Module support is disabled.
-- Version: 8.1.2
-- Build type: Release
-- CXX_STANDARD: 17
-- Performing Test has_std_17_flag
-- Performing Test has_std_17_flag - Success
-- Performing Test has_std_1z_flag
-- Performing Test has_std_1z_flag - Success
-- Required features: cxx_variadic_templates
-- Found LLVM 6.0.0
-- Using LLVMConfig.cmake in: /usr/lib/llvm-6.0/cmake
-- Linker detection: unknown
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Configuring done
-- Generating done

LLVM-6 might be too old for this. I don't know when CXTranslationUnit_IgnoreNonErrorsFromIncludedFiles was introduced but here's the documentation.

I've done my development using LLVM-12.

For Ubuntu 18.04, you could try and install LLVM-10 using this. Hope it helps.