Tatsh / kate-wakatime

Kate plugin to interface with WakaTime
https://tatsh.github.io/kate-wakatime/
11 stars 9 forks source link

Error while executing make #24

Closed notnotrachit closed 1 year ago

notnotrachit commented 1 year ago

Commands I executed successfully:

git clone git@github.com:Tatsh/kate-wakatime.git
cd kate-wakatime
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr

After that I tried executing make command, but I got an error

[ 33%] Automatic MOC for target ktexteditor_wakatime
AutoMoc: /home/rachit/Documents/kate-wakatime/wakatimeplugin.cpp:0: Note: No relevant classes found. No output generated.
[ 33%] Built target ktexteditor_wakatime_autogen
[ 33%] Building CXX object CMakeFiles/ktexteditor_wakatime.dir/ktexteditor_wakatime_autogen/mocs_compilation.cpp.o
In file included from /home/rachit/Documents/kate-wakatime/build/ktexteditor_wakatime_autogen/EWIEGA46WW/moc_wakatimeplugin.cpp:10,
                 from /home/rachit/Documents/kate-wakatime/build/ktexteditor_wakatime_autogen/mocs_compilation.cpp:2:
/home/rachit/Documents/kate-wakatime/build/ktexteditor_wakatime_autogen/EWIEGA46WW/../../../wakatimeplugin.h:25:10: fatal error: KTextEditor/Plugin: No such file or directory
   25 | #include <KTextEditor/Plugin>
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/ktexteditor_wakatime.dir/build.make:86: CMakeFiles/ktexteditor_wakatime.dir/ktexteditor_wakatime_autogen/mocs_compilation.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:678: CMakeFiles/ktexteditor_wakatime.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

My PC: Operating System: KDE neon 5.25 KDE Plasma Version: 5.25.3 KDE Frameworks Version: 5.96.0 Qt Version: 5.15.5 Kernel Version: 5.15.0-41-generic (64-bit) Graphics Platform: X11

notnotrachit commented 1 year ago

I have Kate already installed

notnotrachit commented 1 year ago

Ok, I tried again and seems like I ignored few warnings in cmake command as well

rachit@rachit-linux:~/Downloads/kate-wakatime/build$ cmake .. -DCMAKE_INSTALL_PREFIX=/usr
-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- 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
-- Setting build type to 'Debug' as none was specified.
-- Looking for __GLIBC__
-- Looking for __GLIBC__ - found
-- Performing Test _OFFT_IS_64BIT
-- Performing Test _OFFT_IS_64BIT - Success
-- Performing Test HAVE_DATE_TIME
-- Performing Test HAVE_DATE_TIME - Success
-- Installing in the same prefix as Qt, adopting their path scheme.
-- Found X11: /usr/include   
-- 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
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found Gettext: /usr/bin/msgmerge (found version "0.19.8.1") 
CMake Warning at /usr/share/cmake-3.22/Modules/CMakeFindDependencyMacro.cmake:47 (find_package):
  By not providing "FindKF5SyntaxHighlighting.cmake" in CMAKE_MODULE_PATH
  this project has asked CMake to find a package configuration file provided
  by "KF5SyntaxHighlighting", but CMake did not find one.

  Could not find a package configuration file provided by
  "KF5SyntaxHighlighting" (requested version 5.96.0) with any of the
  following names:

    KF5SyntaxHighlightingConfig.cmake
    kf5syntaxhighlighting-config.cmake

  Add the installation prefix of "KF5SyntaxHighlighting" to CMAKE_PREFIX_PATH
  or set "KF5SyntaxHighlighting_DIR" to a directory containing one of the
  above files.  If "KF5SyntaxHighlighting" provides a separate development
  package or SDK, be sure it has been installed.
Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/KF5TextEditor/KF5TextEditorConfig.cmake:40 (find_dependency)
  CMakeLists.txt:27 (find_package)

CMake Warning at CMakeLists.txt:27 (find_package):
  Found package configuration file:

    /usr/lib/x86_64-linux-gnu/cmake/KF5TextEditor/KF5TextEditorConfig.cmake

  but it set KF5TextEditor_FOUND to FALSE so package "KF5TextEditor" is
  considered to be NOT FOUND.  Reason given by package:

  KF5TextEditor could not be found because dependency KF5SyntaxHighlighting
  could not be found.

-- Configuring done
CMake Warning (dev) at CMakeLists.txt:35 (add_library):
  Policy CMP0028 is not set: Double colon in target name means ALIAS or
  IMPORTED target.  Run "cmake --help-policy CMP0028" for policy details.
  Use the cmake_policy command to set the policy and suppress this warning.

  Target "ktexteditor_wakatime" links to target "KF5::TextEditor" but the
  target was not found.  Perhaps a find_package() call is missing for an
  IMPORTED target, or an ALIAS target is missing?
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /home/rachit/Downloads/kate-wakatime/build
Tatsh commented 1 year ago

So it seems you need KF5SyntaxHighlighting or some kind of package like it to be installed as well. That is a separate package on Gentoo as well (kde-frameworks/syntax-highlighting).

notnotrachit commented 1 year ago

I'm on KDE neon (debian). I tried building it from source and was successful in that. But then I got the same error while building kate-wakatime. Can you help please

Tatsh commented 1 year ago

I think you need libkf5syntaxhighlighting-dev installed. Install that and try building it again.

notnotrachit commented 1 year ago

Still got error

rachit@rachit-linux:~/Downloads/kate-wakatime/build$ make
[ 33%] Automatic MOC for target ktexteditor_wakatime
[ 33%] Built target ktexteditor_wakatime_autogen
Consolidate compiler generated dependencies of target ktexteditor_wakatime
[ 33%] Building CXX object CMakeFiles/ktexteditor_wakatime.dir/wakatimeplugin.cpp.o
/home/rachit/Downloads/kate-wakatime/wakatimeplugin.cpp:36:10: fatal error: KF5/ktexteditor_version.h: No such file or directory
   36 | #include <KF5/ktexteditor_version.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/ktexteditor_wakatime.dir/build.make:100: CMakeFiles/ktexteditor_wakatime.dir/wakatimeplugin.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:705: CMakeFiles/ktexteditor_wakatime.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

😭

notnotrachit commented 1 year ago

However the file is already present at /usr/include/KF5/KTextEditor/ktexteditor_version.h

notnotrachit commented 1 year ago

ok wait, I think I fixed it

notnotrachit commented 1 year ago

Ya, it works now, but in my dashboard it shows editor, machine, OS as unknown, any way to fix it?

notnotrachit commented 1 year ago

oh nvm, I think its an issue of wakapi.

Thanks a lot