LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-20-2008, 04:56 AM   #1
ivanatora
Member
 
Registered: Sep 2003
Location: Bulgaria
Distribution: Ubuntu 9.10, FreeBSD 7.2
Posts: 459

Rep: Reputation: 32
Can't compile libnfnetlink and libnetfilter_conntrack


Hello,
I can't understand if the source is broken or something is wrong with my box. I'm on Slackware 12 and this is what 'make' makes:
Code:
(12:51:16)[ivanatora@~/Archives/conntrack/libnfnetlink-0.0.33]$ make
Making all in src
make[1]: Entering directory `/home/ivanatora/Archives/conntrack/libnfnetlink-0.0.33/src'
/bin/sh ../libtool --tag=CC   --mode=compile gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"libnfnetlink\" -DVERSION=\"0.0.33\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -I.  -I../include   -fPIC -Wall -g -O2 -MT libnfnetlink.lo -MD -MP -MF .deps/libnfnetlink.Tpo -c -o libnfnetlink.lo libnfnetlink.c
 gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"libnfnetlink\" -DVERSION=\"0.0.33\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -I. -I../include -fPIC -Wall -g -O2 -MT libnfnetlink.lo -MD -MP -MF .deps/libnfnetlink.Tpo -c libnfnetlink.c  -fPIC -DPIC -o .libs/libnfnetlink.o
In file included from ../include/libnfnetlink/libnfnetlink.h:20,
                 from libnfnetlink.c:52:
../include/libnfnetlink/linux_nfnetlink.h:81: error: expected specifier-qualifier-list before '__be16'
libnfnetlink.c: In function 'nfnl_fill_hdr':
libnfnetlink.c:429: error: 'struct nfgenmsg' has no member named 'res_id'
make[1]: *** [libnfnetlink.lo] Error 1
make[1]: Leaving directory `/home/ivanatora/Archives/conntrack/libnfnetlink-0.0.33/src'
make: *** [all-recursive] Error 1
(12:51:22)[ivanatora@~/Archives/conntrack/libnfnetlink-0.0.33]$
Some other info about my system:
Code:
uname -a
Linux junior 2.6.23.9 #7 SMP Thu Mar 20 23:45:18 EET 2008 i686 Intel(R) Pentium(R) 4 CPU 3.00GHz GenuineIntel GNU/Linux
gcc -v
Reading specs from /usr/lib/gcc/i486-slackware-linux/4.1.2/specs
Target: i486-slackware-linux
Configured with: ../gcc-4.1.2/configure --prefix=/usr --enable-shared --enable-languages=ada,c,c++,fortran,java,objc --enable-threads=posix --enable-__cxa_atexit --disable-checking --with-gnu-ld --verbose --with-arch=i486 --target=i486-slackware-linux --host=i486-slackware-linux
Thread model: posix
gcc version 4.1.2
I tried searching for a precompiled package for Slackware but the one I found on linuxpackages.net is an old version - 0.30 instead of 0.33

When I try compiling libnetfilter_conntrack, I face the same problem:
Code:
 gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"libnetfilter_conntrack\" -DVERSION=\"0.0.89\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_INET_NTOP=1 -DHAVE_INET_NTOP_IPV6=1 -I. -I. -I../../include -fPIC -Wall -g -O2 -DLIBNETFILTER_CONNTRACK_DIR=\"/usr/local/lib/libnetfilter_conntrack/\" -MT api.lo -MD -MP -MF .deps/api.Tpo -c api.c  -fPIC -DPIC -o .libs/api.o
In file included from /usr/include/libnfnetlink/libnfnetlink.h:19,
                 from ../../include/internal.h:23,
                 from api.c:13:
/usr/include/linux/netlink.h:22: error: expected specifier-qualifier-list before '__u32'
/usr/include/linux/netlink.h:28: error: expected specifier-qualifier-list before '__u32'
In file included from /usr/include/libnfnetlink/libnfnetlink.h:20,
                 from ../../include/internal.h:23,
                 from api.c:13:
/usr/include/libnfnetlink/linux_nfnetlink.h:81: error: expected specifier-qualifier-list before '__be16'
api.c: In function 'nfct_parse_conntrack':
api.c:526: error: 'const struct nlmsghdr' has no member named 'nlmsg_len'
api.c:545: warning: passing argument 2 of '__parse_conntrack' from incompatible pointer type
make[2]: *** [api.lo] Error 1
make[2]: Leaving directory `/home/ivanatora/Archives/conntrack/libnetfilter_conntrack-0.0.89/src/conntrack'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/ivanatora/Archives/conntrack/libnetfilter_conntrack-0.0.89/src'
make: *** [all-recursive] Error 1
The sources are taken from netfilter.org
 
Old 04-20-2008, 12:05 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
No problems on a clean slack-12 with kernel 2.6.21.5,
identical compilers, same compiler setup.
With your kernel 2.6.23.9 the included linux/headers could be different.
(See "programs.c" #include linux/.....h)
 
Old 04-20-2008, 12:33 PM   #3
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367

Rep: Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843
It compiles fine on Slackware 12.0 with a custom 2.6.24.4 kernel (gcc 4.1.2 -- default Slack 12). When you compiled your kernel, did you install the kernel headers as well? (That would be a bad thing -- you should never upgrade the kernel headers. gcc, glibc and other stuff was built against the 2.6.21.5 kernel headers included in Slackware, and therefore you could get compile errors if you upgrade the kernel headers).

Good luck.
 
Old 04-22-2008, 09:03 AM   #4
ivanatora
Member
 
Registered: Sep 2003
Location: Bulgaria
Distribution: Ubuntu 9.10, FreeBSD 7.2
Posts: 459

Original Poster
Rep: Reputation: 32
What do you mean with 'did I installed the kernel headers'? It is custom compiled kernel and sources are still in the same directory - /home/ivanatora/Archives/linux-2.6.23.9/
I have /usr/src/linux/ symlinked to that directory.
 
Old 04-22-2008, 11:15 PM   #5
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367

Rep: Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843
ivanatora, you don't need the symlink from /usr/src/linux to your kernel source directory -- it'll pick it up just fine (though you can always keep the symlink if you want, since in Slackware, at least, it doesn't break anything). When you compiled your kernel, how did you install it? There's a command like `make install_headers` that some poorly written kernel compilation guides will tell you to use, which is totally wrong. gcc, glibc, etc. were built against the 2.6.21.5 kernel headers, and therefore the kernel headers should never be upgraded. The best (or one of the best) guide(s) to follow is Alien Bob's kernel compilation guide, here: http://alien.slackbook.org/dokuwiki/...kernelbuilding

`ls /var/log/packages/kernel-headers-2.6.21.5*` should return something. If it doesn't, you removed (or didn't install...?) the kernel-headers package. Download it from your favourite Slackware mirror and install it (using `installpkg packagename.tgz`). If you DID install the kernel headers when you compiled your kernel, but the kernel-headers package is still installed, you could try `upgradepkg --reinstall packagename.tgz` to attempt to reinstall the headers (it's possible that some /usr/include/* files were overwritten by your kernel headers, if you did install them).

Other than that I can't help you (I don't have any other guesses as to why it would/wouldn't work, unless you didn't do a full install and you're missing a dependency somewhere).
 
Old 04-23-2008, 12:59 AM   #6
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
You probably need to et rid of the symlink from /usr/src/linux to your non-standard kernel sources. Many programs expect the included headers to be the same in /usr/include/linux and /usr/src/linux/include. the link /usr/src/linux should point to the original version of the sources which are distributed with Slackware.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[Compile kernel] How to compile/install the modules ? frenchn00b Linux - General 1 09-06-2009 03:18 PM
Installing libnetfilter_conntrack-0.0.50 ahmedken Linux - Security 2 03-19-2007 12:43 PM
iptables with libnfnetlink tbaror Linux - Security 1 11-04-2006 09:50 AM
Compile madwifi, ... compile error , how can i do. ERBRMN Linux - Networking 3 03-08-2006 07:56 PM
ntop compile/post-compile problem? tjb Linux - Software 3 12-28-2004 04:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration