← Back to team overview

multi-touch-dev team mailing list archive

not able to compile using arm-linux-g++

 

All,

I'm trying to link a simple application that is using
mtdev_open() with mtdev library, and I would like to do it using the cpp
compiler.

It is failing, and it looks to me that you need to add the
extern "C" before the routines declaration in mtdev.h.

I added the following patch, which seems to fix the problem.
Or am I missing anything?

Armando

See patch:


diff --git a/include/mtdev.h b/include/mtdev.h
index 84625a5..6b8b0b8 100644
--- a/include/mtdev.h
+++ b/include/mtdev.h
@@ -112,6 +112,11 @@ struct mtdev {
      struct mtdev_state *state;
};

+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
/**
* mtdev_open - open an mtdev converter
* @dev: the mtdev to open
@@ -169,4 +174,9 @@ int mtdev_get(struct mtdev *dev, int fd, struct input_event* ev, int ev_max);
*/
void mtdev_close(struct mtdev *dev);

+#ifdef __cplusplus
+}
+#endif
+
+
#endif



Follow ups

References