ssanthosh243 / semicomplete

Automatically exported from code.google.com/p/semicomplete
0 stars 0 forks source link

Include xdo.h in a C++ program. #60

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Include "xdo.h" in a C++ program.

What is the expected output? What do you see instead?
Program compiled. Instead the compiler prints out the following error message:

«In file included from x11_mouse.cpp:5:0:
/usr/include/xdo.h:530:37: error: expected ‘,’ or ‘...’ before 
‘class’».

What version of the product are you using? On what operating system?
xdotool-2.20110530.1 on Ubuntu 11.10.

Please provide any additional information below.
The problem should be keyword "class" used in the following function 
declaration: 

/**
 * Change the window's classname and or class.
 *
 * @param name The new class name. If NULL, no change.
 * @param class The new class. If NULL, no change.
 */
int xdo_window_setclass(const xdo_t *xdo, Window wid, const char *name,
                        const char *class);

Original issue reported on code.google.com by marco.esposito on 22 Nov 2011 at 11:23

GoogleCodeExporter commented 9 years ago
It sounds like you may have forgotten to wrap the #include statement in
extern "C" {  }

see: http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html#faq-32.3

Original comment by kirk.kel...@0x4b.net on 7 Dec 2011 at 9:09

GoogleCodeExporter commented 9 years ago
using gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-48), with extern "C", Seeing the 
same issue.  

"class" is a c++ keyword.  
extern "C" affects only linking (name mangling, abi, calling convention, etc).  
extern "C" It does _not_ change source parsing.  Therefore it still refuses to 
compile.

Original comment by jcwen...@gmail.com on 12 Mar 2012 at 3:26

GoogleCodeExporter commented 9 years ago
This is fixed in master: http://github.com/jordansissel/xdotool

New release will happen probably sometime this month.

Original comment by j...@semicomplete.com on 12 Mar 2012 at 5:11