1

I am trying to compile the example C code provided here http://www.bani.com.br/lang/en/2012/05/programmatically-managing-iptables-rules-in-c-iptc/

using (as described in the post):

cc `pkg-config –cflags –libs libiptc` iptablesExample_2.c -o iptablesExample_2

I have also tried compiling it using:

sudo gcc -g -o iptablesExample_2 iptablesExample_2.c -liptc -liptables -ldl

it did not work also and the error this time was:

/usr/bin/ld: cannot find -liptables   
collect2: ld returned 1 exit status

I also tried the example provided at the end of this http://wiki.tldp.org/iptc%20library%20HOWTO And I had the same issues

Linux kernel: 3.8.2 iptables version: v1.4.12

alk
  • 69,737
  • 10
  • 105
  • 255
Ibra
  • 53
  • 6
  • What is the output of running `pkg-config –cflags –libs libiptc` at the command line? – Sean Bright May 15 '14 at 16:27
  • Where does `libiptables` come from? Does it compile without the linker option `-liptables`? – alk May 15 '14 at 17:27
  • 1
    Thanks, it has been solved. I compiled it using sudo gcc -g -o iptablesExample iptablesExample.c -liptc -lip4tc -lip6tc -ldl – Ibra May 16 '14 at 13:22
  • 3
    You might like to add an answer to your own question and also accept is answer. This way SO detects you question as answered. – alk May 24 '14 at 12:11

0 Answers0