Comments (8)
@markuman put -lnl or -lnl-3 to https://github.com/git-hulk/tcpkit/blob/master/src/Makefile#L5 , if failed with missing nl library, try install libnl-dev or libnl3-dev
from tcpkit.
thx for the fast reply.
core/libnl 3.4.0-1 [installed]
was already installed
but unfortunately
diff --git a/src/Makefile b/src/Makefile
index b652517..5eb2089 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -2,7 +2,7 @@ CC = gcc
CFLAGS = -g -Wall
CINCLUDES = -I../deps/libpcap/ -I../deps/lua/src
CLIBS = ../deps/libpcap/libpcap.a ../deps/lua/src/liblua.a
-LOAD_LIBS=-lm -ldl -lpthread
+LOAD_LIBS=-lm -lnl-3 -ldl -lpthread
INSTALL=/usr/bin/install
INSTALLDIR=/usr/local
doesn't solve the problem
gcc -g -Wall -o tcpkit util.o array.o hashtable.o logger.o packet.o redis.o server.o sniffer.o stats.o tcpkit.o vm.o -I../deps/libpcap/ -I../deps/lua/src ../deps/libpcap/libpcap.a ../deps/lua/src/liblua.a -lm -lnl-3 -ldl -lpthread
/usr/bin/ld: ../deps/lua/src/liblua.a(loslib.o): in function `os_tmpname':
/tmp/tcpkit/deps/lua/src/loslib.c:107: warning: the use of `tmpnam' is dangerous, better use `mkstemp'
/usr/bin/ld: ../deps/libpcap/libpcap.a(pcap-linux.o): in function `nl80211_init':
/tmp/tcpkit/deps/libpcap/./pcap-linux.c:681: undefined reference to `genl_connect'
/usr/bin/ld: /tmp/tcpkit/deps/libpcap/./pcap-linux.c:687: undefined reference to `genl_ctrl_alloc_cache'
/usr/bin/ld: /tmp/tcpkit/deps/libpcap/./pcap-linux.c:695: undefined reference to `genl_ctrl_search_by_name'
/usr/bin/ld: ../deps/libpcap/libpcap.a(pcap-linux.o): in function `nl80211_cleanup':
/tmp/tcpkit/deps/libpcap/./pcap-linux.c:714: undefined reference to `genl_family_put'
/usr/bin/ld: ../deps/libpcap/libpcap.a(pcap-linux.o): in function `del_mon_if':
/tmp/tcpkit/deps/libpcap/./pcap-linux.c:853: undefined reference to `genl_family_get_id'
/usr/bin/ld: /tmp/tcpkit/deps/libpcap/./pcap-linux.c:853: undefined reference to `genlmsg_put'
/usr/bin/ld: ../deps/libpcap/libpcap.a(pcap-linux.o): in function `add_mon_if':
/tmp/tcpkit/deps/libpcap/./pcap-linux.c:743: undefined reference to `genl_family_get_id'
/usr/bin/ld: /tmp/tcpkit/deps/libpcap/./pcap-linux.c:743: undefined reference to `genlmsg_put'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:24: tcpkit] Error 1
make[1]: Leaving directory '/tmp/tcpkit/src'
make: *** [Makefile:4: all] Error 2
from tcpkit.
using community/libnl1 1.1.4-2 [installed]
diff --git a/src/Makefile b/src/Makefile
index b652517..d6915b9 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -2,7 +2,7 @@ CC = gcc
CFLAGS = -g -Wall
CINCLUDES = -I../deps/libpcap/ -I../deps/lua/src
CLIBS = ../deps/libpcap/libpcap.a ../deps/lua/src/liblua.a
-LOAD_LIBS=-lm -ldl -lpthread
+LOAD_LIBS=-lm -lnl -ldl -lpthread
INSTALL=/usr/bin/install
INSTALLDIR=/usr/local
failed too, but with a different error message
gcc -g -Wall -o tcpkit util.o array.o hashtable.o logger.o packet.o redis.o server.o sniffer.o stats.o tcpkit.o vm.o -I../deps/libpcap/ -I../deps/lua/src ../deps/libpcap/libpcap.a ../deps/lua/src/liblua.a -lm -lnl -ldl -lpthread
/usr/bin/ld: ../deps/lua/src/liblua.a(loslib.o): in function `os_tmpname':
/tmp/tcpkit/deps/lua/src/loslib.c:107: warning: the use of `tmpnam' is dangerous, better use `mkstemp'
/usr/bin/ld: ../deps/libpcap/libpcap.a(pcap-linux.o): in function `nl80211_init':
/tmp/tcpkit/deps/libpcap/./pcap-linux.c:674: undefined reference to `nl_socket_alloc'
/usr/bin/ld: /tmp/tcpkit/deps/libpcap/./pcap-linux.c:707: undefined reference to `nl_socket_free'
/usr/bin/ld: ../deps/libpcap/libpcap.a(pcap-linux.o): in function `nl80211_cleanup':
/tmp/tcpkit/deps/libpcap/./pcap-linux.c:716: undefined reference to `nl_socket_free'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:24: tcpkit] Error 1
make[1]: Leaving directory '/tmp/tcpkit/src'
make: *** [Makefile:4: all] Error 2
from tcpkit.
@markuman which platform you are running? try to find and install libnl-genl-3-dev
from tcpkit.
Arch Linux
from tcpkit.
@markuman hi, sorry for the delay so long, I eventually reproduce and fixed it now
from tcpkit.
@git-hulk thx
now the build is fine without errors. there are just some deprecated notifications
sniffer.c:91:5: warning: 'pcap_lookupdev' is deprecated: use 'pcap_findalldevs' and use the first device [-Wdeprecated-declarations]
and warnings left
/home/m/git/tcpkit/deps/lua/src/loslib.c:107: warning: the use of `tmpnam' is dangerous, better use `mkstemp'
from tcpkit.
@markuman the warning does not affect, I would fix it later. Thanks for your patience, close this issue now.
from tcpkit.
Related Issues (11)
- TODO: support mysql protocol HOT 1
- Completion of error handling HOT 2
- udp packet HOT 1
- Fix signal handler HOT 2
- Remove unnecessary null pointer checks HOT 2
- Supports hostname in server option
- I can't run normally HOT 3
- push new tcp field to user
- TODO: Supports zookeeper protocol
- make failed: collect2: error: ld returned 1 exit status HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tcpkit.