* Re: libnetfilter_conntrack.so and C++
2006-09-25 8:51 libnetfilter_conntrack.so and C++ denis stauffer
2006-09-25 11:18 ` Jan Engelhardt
@ 2006-09-25 12:39 ` Eric Leblond
1 sibling, 0 replies; 3+ messages in thread
From: Eric Leblond @ 2006-09-25 12:39 UTC (permalink / raw)
To: denis stauffer; +Cc: netfilter
[-- Attachment #1.1: Type: text/plain, Size: 643 bytes --]
Hi,
Le lundi 25 septembre 2006 à 10:51 +0200, denis stauffer a écrit :
> Hi everybody,
>
> I'm trying to develop a C++ programm wich uses
> libnetfilter_conntrack.so library. I've encountered a problem when
> linking the library : the called funtions in libnetfilter_contrack are
> not recognized.
> If some one has succeeded to use the libnetfilter_conntrack library
> with g++, please can you gve me some information about how to do it.
>
> Thank's in advance,
> Denis
Coud you try the following patch ?
BR,
--
Éric Leblond, eleblond@inl.fr
Téléphone : 01 44 89 46 39, Fax : 01 44 89 45 01
INL, http://www.inl.fr
[-- Attachment #1.2: libnetfilter_conntrack_g++.diff --]
[-- Type: text/x-patch, Size: 921 bytes --]
Index: include/libnetfilter_conntrack/libnetfilter_conntrack.h
===================================================================
--- include/libnetfilter_conntrack/libnetfilter_conntrack.h (revision 6670)
+++ include/libnetfilter_conntrack/libnetfilter_conntrack.h (working copy)
@@ -8,6 +8,18 @@
#ifndef _LIBNETFILTER_CONNTRACK_H_
#define _LIBNETFILTER_CONNTRACK_H_
+
+/* Disable inline keyword when compiling in strict ANSI conformance */
+#if defined(__STRICT_ANSI__) && !defined(__cplusplus)
+# define inline
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+
#include <netinet/in.h>
#include <libnfnetlink/linux_nfnetlink.h>
#include <libnfnetlink/libnfnetlink.h>
@@ -332,6 +344,8 @@
extern void nfct_build_tuple(struct nfnlhdr *req, int size,
struct nfct_tuple *t, int type);
+#ifdef __cplusplus
+}
+#endif
-
#endif /* _LIBNETFILTER_CONNTRACK_H_ */
[-- Attachment #2: Ceci est une partie de message numériquement signée --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread