← Back to team overview

rohc team mailing list archive

Re: [Question #248312]: How can I compile the example code using g++?

 

Question #248312 on rohc changed:
https://answers.launchpad.net/rohc/+question/248312

    Status: Open => Needs information

Didier Barvaux requested more information:
Re,

The problem is related to the build of a C++ program with g++ with the
ROHC library written in C. The 1.6.1 version of the ROHC library is not
ready for this.

Please apply the following patch on 1.6.1, re-build and install, then
try again to build the example with g++.

Didier


=== modified file 'src/common/rohc.h'
--- src/common/rohc.h	2013-06-08 20:43:28 +0000
+++ src/common/rohc.h	2014-05-07 18:36:14 +0000
@@ -25,6 +25,11 @@
 #ifndef ROHC_H
 #define ROHC_H
 
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
 /**
  * \mainpage
  *
@@ -339,5 +344,9 @@ void ROHC_EXPORT crc_init_table(unsigned
 
 #undef ROHC_EXPORT /* do not pollute outside this header */
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
 

=== modified file 'src/common/rohc_packets.h'
--- src/common/rohc_packets.h	2012-09-08 10:58:03 +0000
+++ src/common/rohc_packets.h	2014-05-07 18:37:16 +0000
@@ -23,6 +23,11 @@
 #ifndef ROHC_PACKETS_H
 #define ROHC_PACKETS_H
 
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
 
 /** Macro that handles DLL export declarations gracefully */
 #ifdef DLL_EXPORT /* passed by autotools on command line */
@@ -100,5 +105,9 @@ const char * ROHC_EXPORT rohc_get_ext_de
 
 #undef ROHC_EXPORT /* do not pollute outside this header */
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
 

=== modified file 'src/common/rohc_traces.h'
--- src/common/rohc_traces.h	2013-08-20 18:26:16 +0000
+++ src/common/rohc_traces.h	2014-05-07 18:36:26 +0000
@@ -25,6 +25,10 @@
 #ifndef ROHC_TRACES_H
 #define ROHC_TRACES_H
 
+#ifdef __cplusplus
+extern "C"
+{
+#endif
 
 /**
  * @brief A general profile number used for traces not related to a specific
@@ -88,6 +92,9 @@ typedef void (*rohc_trace_callback_t) (c
 	__attribute__((format(printf, 4, 5)));
 #endif
 
+#ifdef __cplusplus
+}
+#endif
 
 #endif
 

=== modified file 'src/comp/rohc_comp.h'
--- src/comp/rohc_comp.h	2013-05-20 15:33:18 +0000
+++ src/comp/rohc_comp.h	2014-05-07 18:36:35 +0000
@@ -25,6 +25,11 @@
 #ifndef COMP_H
 #define COMP_H
 
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
 #include "rohc.h"
 #include "rohc_packets.h"
 #include "rohc_traces.h"
@@ -438,5 +443,9 @@ const char * ROHC_EXPORT rohc_comp_get_s
 
 #undef ROHC_EXPORT /* do not pollute outside this header */
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
 

=== modified file 'src/decomp/rohc_decomp.h'
--- src/decomp/rohc_decomp.h	2013-06-08 20:30:03 +0000
+++ src/decomp/rohc_decomp.h	2014-05-07 18:36:40 +0000
@@ -26,6 +26,11 @@
 #ifndef DECOMP_H
 #define DECOMP_H
 
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
 #include "rohc.h"
 #include "rohc_comp.h"
 
@@ -188,5 +193,9 @@ bool ROHC_EXPORT rohc_decomp_set_traces_
 
 #undef ROHC_EXPORT /* do not pollute outside this header */
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif

-- 
You received this question notification because you are a member of ROHC
Team, which is an answer contact for rohc.