Re: Link problems with libxtables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday 2009-05-22 02:28, Michael Lawson (mshindo) wrote:

>I am having problems using a member function of libxtables:
>
>g++ main.cpp Firewall.cpp Rule.cpp Match.cpp IP4Addr.cpp -lxtables -liptc
>/tmp/cce5IKHM.o: In function `print_match(xt_entry_match const*,
>ipt_ip const*, int)':
>Firewall.cpp:(.text+0x326): undefined reference to
>`xtables_find_match(char const*, xtables_tryload,
>xtables_rule_match**)'
>collect2: ld returned 1 exit status
>make: *** [all] Error 1
>
>I understand this is most likely a link problem, can someone point me
>in the right direction ?

We need this

parent a869eab48f6cf27ffc9b7ed5b2303ff2bd3e943c (v1.4.3.2-4-ga869eab)
commit ab63b538b69379236f9cc1be9040e342eef433fb
Author: Jan Engelhardt <jengelh@xxxxxxxxxx>
Date:   Fri May 22 11:46:55 2009 +0200

xtables: use extern "C"

Signed-off-by: Jan Engelhardt <jengelh@xxxxxxxxxx>
---
 include/xtables.h.in |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/include/xtables.h.in b/include/xtables.h.in
index a399f90..4d4ca0a 100644
--- a/include/xtables.h.in
+++ b/include/xtables.h.in
@@ -203,6 +203,10 @@ struct xtables_globals
 	void (*exit_err)(enum xtables_exittype status, const char *msg, ...) __attribute__((noreturn, format(printf,2,3)));
 };
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 extern const char *xtables_modprobe_program;
 extern struct xtables_match *xtables_matches;
 extern struct xtables_target *xtables_targets;
@@ -295,4 +299,8 @@ extern void _init(void);
 
 #endif
 
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
 #endif /* _XTABLES_H */
-- 
# Created with git-export-patch
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux