Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to compile source (master branch) #5

Open
gomera opened this issue Apr 18, 2019 · 10 comments
Open

Unable to compile source (master branch) #5

gomera opened this issue Apr 18, 2019 · 10 comments
Labels
question Further information is requested

Comments

@gomera
Copy link

gomera commented Apr 18, 2019

Hi @RedFantom, I am trying to compile the tools so that I can get you the mapkeys for my keyboard but I am not able to even pass the first part.

BTW, before this, I was getting another cmake error (unable to find X11) which was solved by adding one extra dependency: libx11-dev. (I've just realized that this is because I was also compiling some examples, I commented that line but the error is still there, even after a clean)

gomera@deathscythe:~/projects/masterkeys-linux$ cmake .
-- The C compiler identification is GNU 8.2.0
-- The CXX compiler identification is GNU 8.2.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
CMake Error at libmk/CMakeLists.txt:5 (include):
  include could not find load file:

    FindLibUSB.cmake
Call Stack (most recent call first):
  CMakeLists.txt:6 (include)


-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.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
CMake Error at examples/ambilight/CMakeLists.txt:5 (include):
  include could not find load file:

    FindLibUSB.cmake
Call Stack (most recent call first):
  examples/CMakeLists.txt:7 (include)
  CMakeLists.txt:10 (include)


/usr/include
/usr/lib/x86_64-linux-gnu/libX11.so
-- Configuring incomplete, errors occurred!
See also "/home/gomera/projects/masterkeys-linux/CMakeFiles/CMakeOutput.log".
@RedFantom RedFantom added the question Further information is requested label Apr 19, 2019
@RedFantom
Copy link
Owner

I do not have this issue using CMake 3.10.2. What platform are you using? What version of CMake have you got installed (cmake --version)? To be honest, I do not have a lot of experience with CMake and will have to take a closer look at the file-finding, but having the exact environment you are using might help in doing so.

The libx11-dev dependency is mentioned in the README.md file, by the way.

@gomera
Copy link
Author

gomera commented Apr 19, 2019

gomera@deathscythe:/opt$ cmake --version
cmake version 3.12.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).
gomera@deathscythe:/opt$ uname -a
Linux deathscythe 4.18.0-17-generic #18-Ubuntu SMP Wed Mar 13 14:34:40 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
gomera@deathscythe:/opt$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.10
DISTRIB_CODENAME=cosmic
DISTRIB_DESCRIPTION="Ubuntu 18.10"

@RedFantom
Copy link
Owner

Unfortunately, I am currently not at my main computer and thus I cannot test your configuration in a VM, but just using CMake 3.12.1 I did not experience any problems. Therefore, I have created a branch that contains the CMake files merged into a single CMakeLists.txt file, so that FindLibUSB.cmake does not have to be found anymore. It is called unified. Could you try building the tools using that?

I had split the files to allow for easier editing of the files for each separate module of the project, but if that does not work consistently then having only a single CMakeLists.txt would not be a problem.

@gomera
Copy link
Author

gomera commented Apr 25, 2019

@RedFantom now I am getting an error on cmake .

gomera@deathscythe:~/projects/masterkeys-linux$ cmake .
CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
CMAKE_FIND_LIBRARY_PREFIXES
CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
CMAKE_FIND_LIBRARY_SUFFIXES
-- The C compiler identification is GNU 8.2.0
-- The CXX compiler identification is GNU 8.2.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
-- Configuring incomplete, errors occurred!
See also "/home/gomera/projects/masterkeys-linux/CMakeFiles/CMakeOutput.log".

@gomera
Copy link
Author

gomera commented Apr 25, 2019

This is the log file:

CMakeOutput.log

@RedFantom
Copy link
Owner

Thank you for your reply! My apologies, I made mistake in committing the result to GitHub, so the CMakeLists.txt file that was previously in the branch did not work.

I just committed and pushed a commit that fixes the issue by moving the project() call to the top of the file, and now everything compiles correctly on my main PC. Would you please give it another try?

@gomera
Copy link
Author

gomera commented Apr 25, 2019

ok, now it seems to be working ! :)

@gomera
Copy link
Author

gomera commented Apr 25, 2019

so, going back to the original topic, how do I use your tool? ;)

@RedFantom
Copy link
Owner

RedFantom commented Apr 25, 2019

You can execute the recording executable using sudo ./record. The sudo permissions are required for accessing the device's USB interface without a udev rule.

Then, during execution, one by one the keys will be coloured red. For the key coloured red, you should enter the row and column in the format r,c from the reference Excel file. Then, after entering the row and column separated by a comma, you press enter. Then the red coloured key will turn green and the next one will turn red. You can skip keys by entering -1,-1 and you can complete the program using -2,-2, after you have successfully entered all the keys.

Note that it is not possible to go back to a previous key if you've made a mistake, so double-check the row and column values before you press enter. The program will not warn you if you enter duplicates.

The produced layout.c file will provide me with the key map that is needed for inclusion in this library, but as the formats are similar that also allows it to be included in libcmmk, as you first intended.

@gomera
Copy link
Author

gomera commented Apr 25, 2019

ok, I am working right now but will do it when I have the time. Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants