Skip to content
This repository was archived by the owner on Aug 30, 2020. It is now read-only.
This repository was archived by the owner on Aug 30, 2020. It is now read-only.

Package not found via config_gen #125

@akshit-sharma

Description

@akshit-sharma

CMake can find X11 package but not ycm-generator

I have a minimal X11 project using cmake. I can successfully the project using cmake followed by make. When ycm-generator does the same, it is unable to find X11 package.

command used for ycm-generator

~/.vim/bundle/YCM-Generator/config_gen.py --verbose --compiler /home/akshit/dotfiles/faaltu/clang+llvm/bin/clang .

Output from ycm-generator

$ cmake /home/akshit/Projects/016_X11_hello_world
-- The C compiler identification is Clang 7.0.0
-- The CXX compiler identification is Clang 7.0.0
-- Check for working C compiler: /home/akshit/.vim/bundle/YCM-Generator/fake-toolchain/Unix/clang
-- Check for working C compiler: /home/akshit/.vim/bundle/YCM-Generator/fake-toolchain/Unix/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Detecting C compile features
-- Detecting C compile features - failed
-- Check for working CXX compiler: /home/akshit/.vim/bundle/YCM-Generator/fake-toolchain/Unix/clang++
-- Check for working CXX compiler: /home/akshit/.vim/bundle/YCM-Generator/fake-toolchain/Unix/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Detecting CXX compile features
-- Detecting CXX compile features - failed
CMake Error at /usr/share/cmake-3.5/Modules/FindX11.cmake:439 (message):
  Could not find X11
Call Stack (most recent call first):
  CMakeLists.txt:9 (find_package)


-- Configuring incomplete, errors occurred!
See also "/tmp/tmpPJmZJt/CMakeFiles/CMakeOutput.log".
See also "/tmp/tmpPJmZJt/CMakeFiles/CMakeError.log".

Running make...
$ make -i -j12
make: *** No targets specified and no makefile found.  Stop.

Cleaning up...

Build completed in 0.38 sec

Collected 0 relevant entries for C compilation (0 discarded).
Collected 0 relevant entries for C++ compilation (0 discarded).

ERROR: No commands were logged to the build logs (C: /tmp/tmpBUv4Kz, C++: /tmp/tmp4rRmyb).
Your build system may not be compatible.

Output from cmake for building project

-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Found X11: /usr/lib/x86_64-linux-gnu/libX11.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/akshit/Projects/016_X11_hello_world/build

Currently my cmake file contains

cmake_minimum_required(VERSION 3.2)
project(x11_world)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(X11 REQUIRED)

include_directories(${X11_INCLUDE_DIR})
add_executable(x11_world main.cpp)
target_link_libraries(x11_world ${X11_LIBRARIES} )

Can you help me generating the ycm files for the project ?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions