How to install net link to use in a C program?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
1
down vote

favorite












I want to install libnl package so I can use its APIs to communicate with wireless driver of my computer. I have checked the package status with dpkg -s libnl-3-200. The result is:



Package: libnl-3-200
Status: install ok installed
Priority: optional
Section: libs
Installed-Size: 168
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: amd64
Multi-Arch: same
Source: libnl3
Version: 3.2.27-1ubuntu0.16.04.1
Depends: libc6 (>= 2.14)
Conffiles:
/etc/libnl-3/classid 3e07259e58674631830b152e983ca995
/etc/libnl-3/pktloc 7613dbc41b2dc3258195b6b6abd0f179
Description: library for dealing with netlink sockets
This is a library for applications dealing with netlink sockets.
The library provides an interface for raw netlink messaging and various
netlink family specific interfaces.
Homepage: http://www.infradead.org/~tgr/libnl/
Original-Maintainer: Heiko Stuebner <mmind@debian.org>


In order to write program, I need to include files like:



#include <netlink/netlink.h>
#include <netlink/cache.h>
#include <netlink/route/link.h>


But the make cannot find these header files and my /usr/include/ does not have netlink folder. My /usr/lib/ does not have anything with libnl in it. Should I install another package?










share|improve this question

















  • 2




    Yes: libnl-3-dev
    – steeldriver
    Apr 18 at 16:00










  • Thanks! I installed it. For some reason the includes are installed in /usr/include/libnl3/netlink folder. This causes make to give me errors since other includes in included files assume netlink folder is in /usr/include/ and not in /usr/include/libnl3/. Can I move netlink folder from /usr/include/libnl3/ to /usr/include/ without causing any problems?
    – Masoud
    Apr 18 at 16:23







  • 1




    NO! don't mess with location of system files. Instead use pkg-config --cflags or add an appropriate -I directive
    – steeldriver
    Apr 18 at 16:57










  • I did define an -I directive and it solved the problem. Now I need to provide make with a library name. What is that name? I am looking for a library in /usr/lib/ folder but I cannot find any folder or file with libnl in its name.
    – Masoud
    Apr 18 at 20:07










  • According to pkg-config --libs libnl-3.0 the appropriate library directive is -lnl-3 (corresponding to library name libnl-3)
    – steeldriver
    Apr 18 at 21:32














up vote
1
down vote

favorite












I want to install libnl package so I can use its APIs to communicate with wireless driver of my computer. I have checked the package status with dpkg -s libnl-3-200. The result is:



Package: libnl-3-200
Status: install ok installed
Priority: optional
Section: libs
Installed-Size: 168
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: amd64
Multi-Arch: same
Source: libnl3
Version: 3.2.27-1ubuntu0.16.04.1
Depends: libc6 (>= 2.14)
Conffiles:
/etc/libnl-3/classid 3e07259e58674631830b152e983ca995
/etc/libnl-3/pktloc 7613dbc41b2dc3258195b6b6abd0f179
Description: library for dealing with netlink sockets
This is a library for applications dealing with netlink sockets.
The library provides an interface for raw netlink messaging and various
netlink family specific interfaces.
Homepage: http://www.infradead.org/~tgr/libnl/
Original-Maintainer: Heiko Stuebner <mmind@debian.org>


In order to write program, I need to include files like:



#include <netlink/netlink.h>
#include <netlink/cache.h>
#include <netlink/route/link.h>


But the make cannot find these header files and my /usr/include/ does not have netlink folder. My /usr/lib/ does not have anything with libnl in it. Should I install another package?










share|improve this question

















  • 2




    Yes: libnl-3-dev
    – steeldriver
    Apr 18 at 16:00










  • Thanks! I installed it. For some reason the includes are installed in /usr/include/libnl3/netlink folder. This causes make to give me errors since other includes in included files assume netlink folder is in /usr/include/ and not in /usr/include/libnl3/. Can I move netlink folder from /usr/include/libnl3/ to /usr/include/ without causing any problems?
    – Masoud
    Apr 18 at 16:23







  • 1




    NO! don't mess with location of system files. Instead use pkg-config --cflags or add an appropriate -I directive
    – steeldriver
    Apr 18 at 16:57










  • I did define an -I directive and it solved the problem. Now I need to provide make with a library name. What is that name? I am looking for a library in /usr/lib/ folder but I cannot find any folder or file with libnl in its name.
    – Masoud
    Apr 18 at 20:07










  • According to pkg-config --libs libnl-3.0 the appropriate library directive is -lnl-3 (corresponding to library name libnl-3)
    – steeldriver
    Apr 18 at 21:32












up vote
1
down vote

favorite









up vote
1
down vote

favorite











I want to install libnl package so I can use its APIs to communicate with wireless driver of my computer. I have checked the package status with dpkg -s libnl-3-200. The result is:



Package: libnl-3-200
Status: install ok installed
Priority: optional
Section: libs
Installed-Size: 168
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: amd64
Multi-Arch: same
Source: libnl3
Version: 3.2.27-1ubuntu0.16.04.1
Depends: libc6 (>= 2.14)
Conffiles:
/etc/libnl-3/classid 3e07259e58674631830b152e983ca995
/etc/libnl-3/pktloc 7613dbc41b2dc3258195b6b6abd0f179
Description: library for dealing with netlink sockets
This is a library for applications dealing with netlink sockets.
The library provides an interface for raw netlink messaging and various
netlink family specific interfaces.
Homepage: http://www.infradead.org/~tgr/libnl/
Original-Maintainer: Heiko Stuebner <mmind@debian.org>


In order to write program, I need to include files like:



#include <netlink/netlink.h>
#include <netlink/cache.h>
#include <netlink/route/link.h>


But the make cannot find these header files and my /usr/include/ does not have netlink folder. My /usr/lib/ does not have anything with libnl in it. Should I install another package?










share|improve this question













I want to install libnl package so I can use its APIs to communicate with wireless driver of my computer. I have checked the package status with dpkg -s libnl-3-200. The result is:



Package: libnl-3-200
Status: install ok installed
Priority: optional
Section: libs
Installed-Size: 168
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: amd64
Multi-Arch: same
Source: libnl3
Version: 3.2.27-1ubuntu0.16.04.1
Depends: libc6 (>= 2.14)
Conffiles:
/etc/libnl-3/classid 3e07259e58674631830b152e983ca995
/etc/libnl-3/pktloc 7613dbc41b2dc3258195b6b6abd0f179
Description: library for dealing with netlink sockets
This is a library for applications dealing with netlink sockets.
The library provides an interface for raw netlink messaging and various
netlink family specific interfaces.
Homepage: http://www.infradead.org/~tgr/libnl/
Original-Maintainer: Heiko Stuebner <mmind@debian.org>


In order to write program, I need to include files like:



#include <netlink/netlink.h>
#include <netlink/cache.h>
#include <netlink/route/link.h>


But the make cannot find these header files and my /usr/include/ does not have netlink folder. My /usr/lib/ does not have anything with libnl in it. Should I install another package?







wireless libraries






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Apr 18 at 15:55









Masoud

134




134







  • 2




    Yes: libnl-3-dev
    – steeldriver
    Apr 18 at 16:00










  • Thanks! I installed it. For some reason the includes are installed in /usr/include/libnl3/netlink folder. This causes make to give me errors since other includes in included files assume netlink folder is in /usr/include/ and not in /usr/include/libnl3/. Can I move netlink folder from /usr/include/libnl3/ to /usr/include/ without causing any problems?
    – Masoud
    Apr 18 at 16:23







  • 1




    NO! don't mess with location of system files. Instead use pkg-config --cflags or add an appropriate -I directive
    – steeldriver
    Apr 18 at 16:57










  • I did define an -I directive and it solved the problem. Now I need to provide make with a library name. What is that name? I am looking for a library in /usr/lib/ folder but I cannot find any folder or file with libnl in its name.
    – Masoud
    Apr 18 at 20:07










  • According to pkg-config --libs libnl-3.0 the appropriate library directive is -lnl-3 (corresponding to library name libnl-3)
    – steeldriver
    Apr 18 at 21:32












  • 2




    Yes: libnl-3-dev
    – steeldriver
    Apr 18 at 16:00










  • Thanks! I installed it. For some reason the includes are installed in /usr/include/libnl3/netlink folder. This causes make to give me errors since other includes in included files assume netlink folder is in /usr/include/ and not in /usr/include/libnl3/. Can I move netlink folder from /usr/include/libnl3/ to /usr/include/ without causing any problems?
    – Masoud
    Apr 18 at 16:23







  • 1




    NO! don't mess with location of system files. Instead use pkg-config --cflags or add an appropriate -I directive
    – steeldriver
    Apr 18 at 16:57










  • I did define an -I directive and it solved the problem. Now I need to provide make with a library name. What is that name? I am looking for a library in /usr/lib/ folder but I cannot find any folder or file with libnl in its name.
    – Masoud
    Apr 18 at 20:07










  • According to pkg-config --libs libnl-3.0 the appropriate library directive is -lnl-3 (corresponding to library name libnl-3)
    – steeldriver
    Apr 18 at 21:32







2




2




Yes: libnl-3-dev
– steeldriver
Apr 18 at 16:00




Yes: libnl-3-dev
– steeldriver
Apr 18 at 16:00












Thanks! I installed it. For some reason the includes are installed in /usr/include/libnl3/netlink folder. This causes make to give me errors since other includes in included files assume netlink folder is in /usr/include/ and not in /usr/include/libnl3/. Can I move netlink folder from /usr/include/libnl3/ to /usr/include/ without causing any problems?
– Masoud
Apr 18 at 16:23





Thanks! I installed it. For some reason the includes are installed in /usr/include/libnl3/netlink folder. This causes make to give me errors since other includes in included files assume netlink folder is in /usr/include/ and not in /usr/include/libnl3/. Can I move netlink folder from /usr/include/libnl3/ to /usr/include/ without causing any problems?
– Masoud
Apr 18 at 16:23





1




1




NO! don't mess with location of system files. Instead use pkg-config --cflags or add an appropriate -I directive
– steeldriver
Apr 18 at 16:57




NO! don't mess with location of system files. Instead use pkg-config --cflags or add an appropriate -I directive
– steeldriver
Apr 18 at 16:57












I did define an -I directive and it solved the problem. Now I need to provide make with a library name. What is that name? I am looking for a library in /usr/lib/ folder but I cannot find any folder or file with libnl in its name.
– Masoud
Apr 18 at 20:07




I did define an -I directive and it solved the problem. Now I need to provide make with a library name. What is that name? I am looking for a library in /usr/lib/ folder but I cannot find any folder or file with libnl in its name.
– Masoud
Apr 18 at 20:07












According to pkg-config --libs libnl-3.0 the appropriate library directive is -lnl-3 (corresponding to library name libnl-3)
– steeldriver
Apr 18 at 21:32




According to pkg-config --libs libnl-3.0 the appropriate library directive is -lnl-3 (corresponding to library name libnl-3)
– steeldriver
Apr 18 at 21:32















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1026150%2fhow-to-install-net-link-to-use-in-a-c-program%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1026150%2fhow-to-install-net-link-to-use-in-a-c-program%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

pylint3 and pip3 broken

Missing snmpget and snmpwalk

How to enroll fingerprints to Ubuntu 17.10 with VFS491