Compiling C++ Gesture Server in Eclipse and MinGW and boost

90 views
Skip to first unread message

Ashley

unread,
Sep 26, 2011, 2:33:12 PM9/26/11
to sparsh-ui
Hi, I was trying to compile the C++ Gesture Server in Eclipse CDT and
I use MinGW's gcc and MySys's make along with boost 1.47.0 in Windows
7 64-bit environment and I was having some road blocks. It seems the
GestureServer-C++.zip I have downloaded is based on a Linux
environment and it hasn't been tested well in Windows environment. So,
these couple of things I had to change in order to make it compile in
windows 7:

1) In the debug.h the LOG_FILE hasn't been defined for WINDOWS and the
preprocessor definition for debug_msg throws error when compiled in
Windows.

Error: "common/debug.h:19:28: error: 'LOG_FILE' was not declared in
this scope"
The code could be

#ifndef DEBUG_H_
#define DEBUG_H_
<code>
#include <stdio.h>
// TODO find out why I couldn't declare this a const *
#ifdef LINUX
#define LOG_FILE "/var/log/sparsh.log"
#elif defined WINDOWS
#define LOG_FILE "C:\\log\\sparsh.log"
#endif

#ifdef DEBUG

#define debug_msg(_format,_aa...) \
FILE * outputFile = fopen(LOG_FILE, "a+"); \
fprintf(outputFile, "File=%s,Func=%s,Line=%d:\n", __FILE__, __func__,
__LINE__); \
fclose(outputFile);
#endif
#endif /*DEBUG_H_*/
</code>

2) In the Properties > C/C++ Build > Tool Chain Editor > Current
toolchain needs to be changed from Linux GCC to MinGW GCC

3) ..\Gestures\/MultiPointDragGesture.h:21:17: error: 'stdext' is not
a namespace-name

I changed the code to comment using namespace stdext and move using
namespace __gnu_cxx out the #ifdef scope
<code>
#ifdef _WIN32
#include <hash_map>
//using namespace stdext;
#else
#include <ext/hash_map>
#endif /* _WIN32 */
using namespace __gnu_cxx;
</code>

Hope if helps someone like me

Thanks
Ashley

Jay

unread,
Sep 26, 2011, 7:21:42 PM9/26/11
to sparsh-ui
Thanks for this, Ashley. I've graduated since working on this project
and am not actively developing it anymore. I'll see what I can do to
get these changes committed.

Ashley

unread,
Sep 28, 2011, 11:42:16 AM9/28/11
to sparsh-ui
Also forgot to mention to refer "ws2_32" library in windows

Thanks,
Ashley
Reply all
Reply to author
Forward
0 new messages