routerkeygen / routerkeygenPC

Qt Port for Linux, Mac OSX and Windows
GNU General Public License v3.0
288 stars 89 forks source link

don't build on kali 2018.3a - missing "NetworkManager.h" #45

Open RobertoD91 opened 5 years ago

RobertoD91 commented 5 years ago

Hi, on kali 2018.3a, even after installing network-manager-dev i get this error:

[ 93%] Building CXX object src/CMakeFiles/routerkeygen.dir/wifi/QWifiManager.cpp.o
In file included from /root/Desktop/routerkeygenPC/src/wifi/QWifiManager.cpp:31:
/root/Desktop/routerkeygenPC/src/wifi/QWifiManagerPrivateUnix.h:16:10: fatal error: NetworkManager.h: File o directory non esistente
 #include <NetworkManager.h>
          ^~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [src/CMakeFiles/routerkeygen.dir/build.make:863: src/CMakeFiles/routerkeygen.dir/wifi/QWifiManager.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:218: src/CMakeFiles/routerkeygen.dir/all] Error 2
make: *** [Makefile:152: all] Error 2
Error while building
tsiebecker commented 5 years ago

4.19.0-kali1-amd64 , exactly the same, SOLUTION to this:

`[ 93%] Building CXX object src/CMakeFiles/routerkeygen.dir/wifi/QWifiManager.cpp.o In file included from /root/Downloads/routerkeygenPC/src/wifi/QWifiManager.cpp:31: /root/Downloads/routerkeygenPC/src/wifi/QWifiManagerPrivateUnix.h:16:10: fatal error: NetworkManager.h: Datei oder Verzeichnis nicht gefunden

include

      ^~~~~~~~~~~~~~~~~~

compilation terminated. make[2]: [src/CMakeFiles/routerkeygen.dir/build.make:863: src/CMakeFiles/routerkeygen.dir/wifi/QWifiManager.cpp.o] Fehler 1 make[1]: [CMakeFiles/Makefile2:218: src/CMakeFiles/routerkeygen.dir/all] Fehler 2 make: *** [Makefile:152: all] Fehler 2 Error while building`

  1. git clone --recursive https://github.com/tsiebecker/routerkeygenPC.git
  2. run routerkeygenPC/./build_linux.sh
  3. be happy
  4. if you don't trust my repo, also a step by step solution:

Download Kali-usable Version: (commit I tested it with, newer should work too) https://github.com/RealEnder/routerkeygenPC/commit/5c7bc0747f907acc4e60a8cb9d53406fdff6a29a (git clone --recursive https://github.com/RealEnder/routerkeygenPC.git)

sudo apt install -y cmake build-essential libqt4-dev libqt4-dev libqt4-dev-bin qt4-dev-tools libssl-dev network-manager-dev libsystemd-dev libnm-*

Then download NetworkManager from git: (commit I tested it with, newer should work too) https://github.com/NetworkManager/NetworkManager/commit/128099151d23818501e9d9600aec64fbfe999322 (git clone --recursive https://github.com/NetworkManager/NetworkManager.git)

copy all files from NetworkManager/libnm/ to routerkeygenPC/src/wifi/ modify routerkeygenPC/NetworkManager.h :

ifndef __NETWORKMANAGER_H__

define __NETWORKMANAGER_H__

define NETWORKMANAGER_H_INSIDE

include "nm-dbus-interface.h"

undef NETWORKMANAGER_H_INSIDE

endif / __NETWORKMANAGER_H__ /

(delete other includes)

modify routerkeygenPC/src/wifi/QWifiManagerPrivateUnix.h :

ifndef QWIFIMANAGERPRIVATEUNIXH

define QWIFIMANAGERPRIVATEUNIXH

include "QWifiManagerPrivate.h"

include "NetworkManager.h"

include <QtDBus/QDBusConnection>

include <QtDBus/QDBusInterface>

include <QtDBus/QDBusReply>

class QWifiManagerPrivateUnix: public QWifiManagerPrivate { Q_OBJECT public: QWifiManagerPrivateUnix(); virtual ~QWifiManagerPrivateUnix(); void startScan(); private slots: void updateAccessPoints();

private: QDBusInterface * wirelessDevice; };

endif / QWIFIMANAGERPRIVATEUNIXH /

(!!! #include "NetworkManager.h" NOT #include !!!)

copy all files from NetworkManager/libnm-core/ to routerkeygenPC/src/wifi/ (!!! do NOT override meson.build !!!) (!!! do NOT override tests/ folder !!!)

now run routerkeygenPC/./build_linux.sh everything not working because of NetworkManager.h not found should now be resolved

RealEnder commented 5 years ago

Can you build the commandline version? https://github.com/routerkeygen/routerkeygenPC#commandline-version

tsiebecker commented 5 years ago

Yes, building the cli version was possible without the "fix" from above. But in Kali "libnm-gtk-dev" is non-exsistent. So installing the requirements like written in the README is not possible. Solution:

sudo apt-get install -y cmake build-essential qt5-default libssl-dev qtscript5-dev qttools5-dev qttools5-dev-tools rpm lintian

cli version builds without it, for other version see fix.

P.S.: @RealEnder Big fan, keep up the good work.