I have decided to port nm-cli to my own UI library(libgreattao), but after installing NetworkManager-devel and order to make, there’s nm-serttings.h file missing. In ./usr/include/NetworkManager directory exist nm-setting.h file, but that’s not the same file.
Well, nmcli is included in NetworkManager itself.
That the nmsettings.h files are different is pobably caused by the fact that you downloaded a different version. This might also explain your problems compiling it in the first place.
So try to compile the one contained in openSUSE’s src rpm (available from the source repo) or download the exact same version from github or sourceforge.
And you should probably post exact error messages to get further help.
And how exactly are you compiling it?
Without having looked at nmcli in particular, you should normally run ./configure first, that should set up all include paths correctly among other things so the compiler finds all the include files. Did you do that? You only mentioned “make”. You probably miss some “-I/usr/include/NetworkManager” for the compiler options.
It might also be necessary to build the whole NetworkManager, not only nmcli.
You didn’t understand me. The file nm-settings.h is missing, not different.
I have added source repo, but there’s not NetworkManager-src package.
/home/slawomir/Dokumenty/Projekty/Aplikacje tao/tao-network-manager/src> make -j2
compiling nmc_commands.c (cc)
łączenie nmc-dbus-settings.o (cc)
In file included from nmc_commands.c:33:0:
nmc-dbus-settings.h:30:25: fatal error: nm-settings.h: No such file or directory
#include <nm-settings.h>
In file included from nmc-dbus-settings.c:31:0:
nmc-dbus-settings.h:30:25: fatal error: nm-settings.h: No such file or directory
#include <nm-settings.h>
compilation terminated.
compilation terminated.
<builtin>: recipe for target 'nmc-dbus-settings.o' failed
make: *** [nmc-dbus-settings.o] Error 1
make: *** Waiting for unfinished jobs....
<builtin>: recipe for target 'nmc_commands.o' failed
make: *** [nmc_commands.o] Error 1
*** Porażka: Kod wyjścia 2 ***\
“łączenie nmc-dbus-settings.o (cc)” means “linking nmc-dbus-settings.o (cc)” and “*** Porażka: Kod wyjścia 2 " means "” means “*** Unsuccess. Exit code 2 ***”.
Where is it missing?
In nmcli’s source code?`Of course, as it is part of NetworkManager itself. If you installed NetworkManager-devel, you should have it in /usr/include/NetworkManager/.
I have added source repo, but there’s not NetworkManager-src package.
Of course there is.
“Install” it with “zypper si NetworkManager”. You will find the source code in ~/rpmbuild then (or /usr/src/rpmbuild/ if you do that as root).
/home/slawomir/Dokumenty/Projekty/Aplikacje tao/tao-network-manager/src> make -j2
compiling nmc_commands.c (cc)
łączenie nmc-dbus-settings.o (cc)
In file included from nmc_commands.c:33:0:
nmc-dbus-settings.h:30:25: fatal error: nm-settings.h: No such file or directory #include <nm-settings.h>
In file included from nmc-dbus-settings.c:31:0:
nmc-dbus-settings.h:30:25: fatal error: nm-settings.h: No such file or directory #include <nm-settings.h>
Ah, I see.
NetworkManager-devel only has nm-setting.h (without the ‘s’). You made other typing errors as well, so I didn’t notice. Sorry for the misunderstanding.
I don’t find any “nm-settings.h” in NetworkManager’s source code either.
And there does not even seem to be a nmc-dbus-settings.c or nmc-commands.c in the included nmcli’s source or anywhere else…
So, please clarify which nmcli you are exactly trying to compile? Where did you download it from?
Isn’t there a README file or similar?
Have you run ./configure before?
Is it even compatible with the used NetworkManager?
You don’t seem to understand me.
I’m talking about the nmcli included in NetworkManager.
It doesn’t come with a nm-settings.h, it doesn’t need any nm-settings.h, and it doesn’t even have those source files mentioned in your error messages.
Ok, so it is called “nm-cli”, not “nmcli”. No wonder that I didn’t find it.
But the last change there has been made in 2007!
NetworkManager has completely changed since then, and nmcli is included in NetworkManager itself meanwhile (since 2010) as I wrote already.
I’d say forget that, this is not going to work.
Take the nmcli source code shipped with NetworkManager instead.
No need to compile it yourself, it is part of the NetworkManager package so it should be in /usr/bin anyway.
But I already told you how to “install” the source code anyway (as you want to use it as starting point for your own application), nmcli is in the cli folder.
You can also get the source here: Show openSUSE:13.1:Update / NetworkManager - openSUSE Build Service
Btw, the NetworkManager source code also contains examples, maybe you should look at those as well, they are in the examples directory obviously.
Ok. I have copied /usr/src/packages/SOURCES/NetworkManager-0.9.10.0.tar.xz to my home directory, unpack it and compile. I don’t know where put -lgreattao flag to link with my library.
I’d say, change nmcli’s Makefile accordingly.
You should have one after running ./configure.
Or change Makefile.in before running ./configure.
If you have NetworkManager-devel installed, it should suffice to only compile nmcli I suppose, you probably don’t have to build the whole NetworkManager.
But I haven’t tried yet.