All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jay Hester <jay.hester@khaletech.com>
To: netfilter-devel@lists.netfilter.org
Subject: c++ linking problems
Date: Wed, 12 Apr 2006 16:03:11 -0500	[thread overview]
Message-ID: <443D6B0F.3050206@khaletech.com> (raw)

Hello,
     This is probably something easy that i'm overlooking, but how do 
you link in netfilter_queue in to a c++ program?

     I've lightly modified the code in 
libnetfilter_queue-<vers>/utils/nfqnl_test.c to build a test program. 
When I try to compile the program i'm getting lots of linking errors 
like this:

[jbhester@sidewinder src]$ make
 cd .. && /bin/sh /home/jbhester/projects/midevil/missing --run 
automake-1.9 --gnu  src/Makefile
 cd .. && /bin/sh ./config.status src/Makefile depfiles
config.status: creating src/Makefile
config.status: executing depfiles commands
g++  -g -O2   -o nfq_test  nfq_test.o  -lnetfilter_queue -lnfnetlink
nfq_test.o: In function 
`main':/home/jbhester/projects/midevil/src/nfq_test.cpp:41: undefined 
reference to `nfq_open()'
:/home/jbhester/projects/midevil/src/nfq_test.cpp:47: undefined 
reference to `nfq_unbind_pf(nfq_handle*, unsigned short)'
:/home/jbhester/projects/midevil/src/nfq_test.cpp:52: undefined 
reference to `nfq_bind_pf(nfq_handle*, unsigned short)'
:/home/jbhester/projects/midevil/src/nfq_test.cpp:57: undefined 
reference to `nfq_create_queue(nfq_handle*, unsigned short, int 
(*)(nfq_q_handle*, nfgenmsg*, nfq_data*, void*), void*)'
:/home/jbhester/projects/midevil/src/nfq_test.cpp:63: undefined 
reference to `nfq_set_mode(nfq_q_handle*, unsigned char, unsigned int)'
:/home/jbhester/projects/midevil/src/nfq_test.cpp:68: undefined 
reference to `nfq_nfnlh(nfq_handle*)'
:/home/jbhester/projects/midevil/src/nfq_test.cpp:69: undefined 
reference to `nfnl_fd(nfnl_handle*)'
:/home/jbhester/projects/midevil/src/nfq_test.cpp:73: undefined 
reference to `nfq_handle_packet(nfq_handle*, char*, int)'
:/home/jbhester/projects/midevil/src/nfq_test.cpp:77: undefined 
reference to `nfq_destroy_queue(nfq_q_handle*)'
:/home/jbhester/projects/midevil/src/nfq_test.cpp:80: undefined 
reference to `nfq_close(nfq_handle*)'
nfq_test.o: In function 
`process':/home/jbhester/projects/midevil/src/nfq_test.cpp:19: undefined 
reference to `nfq_get_msg_packet_hdr(nfq_data*)'
:/home/jbhester/projects/midevil/src/nfq_test.cpp:24: undefined 
reference to `nfq_get_payload(nfq_data*, char**)'
:/home/jbhester/projects/midevil/src/nfq_test.cpp:28: undefined 
reference to `nfq_set_verdict(nfq_q_handle*, unsigned int, unsigned int, 
unsigned int, unsigned char*)'
collect2: ld returned 1 exit status
make: *** [nfq_test] Error 1


    I've tried lots of things like adding "nfq_test_LDADD = 
/usr/local/lib/libnetfilter_queue.[a|so]", and using the dynamic linking 
as a dso object, but nothing is working.

    Thanks ahead of time for the help.

Jay

             reply	other threads:[~2006-04-12 21:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-12 21:03 Jay Hester [this message]
2006-04-12 21:23 ` c++ linking problems Julien VALIENTE
2006-04-13  6:44 ` Martijn Lievaart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=443D6B0F.3050206@khaletech.com \
    --to=jay.hester@khaletech.com \
    --cc=netfilter-devel@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.