Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make failing on Ubuntu 15.04 #3

Open
amps211 opened this issue Jul 13, 2015 · 6 comments
Open

Make failing on Ubuntu 15.04 #3

amps211 opened this issue Jul 13, 2015 · 6 comments

Comments

@amps211
Copy link

amps211 commented Jul 13, 2015

make[2]: Entering directory '/home/jb/Projects/xserver-xorg-input-synaptics/src'
  CC       synproto.lo
In file included from /usr/include/string.h:634:0,
                 from /usr/include/xorg/os.h:53,
                 from /usr/include/xorg/misc.h:115,
                 from /usr/include/xorg/xf86str.h:37,
                 from /usr/include/xorg/xf86.h:44,
                 from /usr/include/xorg/xf86Xinput.h:54,
                 from synproto.h:36,
                 from synproto.c:24:
/usr/include/xorg/os.h:541:1: error: expected identifier or '(' before '__extension__'
 strndup(const char *str, size_t n);
 ^
Makefile:504: recipe for target 'synproto.lo' failed
make[2]: *** [synproto.lo] Error 1
make[2]: Leaving directory '/home/jb/Projects/xserver-xorg-input-synaptics/src'

Looks like os.h duplicates prototypes for some system functions unless xorg-server.h is included first, according to this discussion http://lists.x.org/archives/xorg-devel/2014-July/043067.html

Currently os.h cannot be included safely (without it creating duplicate
prototypes for system functions) without first including one of:
dix-config.h
xorg-server.h
xorg-config.h

@mscalone
Copy link

same problem on Ubuntu 15.10.
Any workaround?

@Anfa-am
Copy link

Anfa-am commented Nov 7, 2015

+1 this, 15.10 trying to build a newer version of the preinstalled driver. Same error.

@mdotshell
Copy link

Same issue in 15.10 under Gnome 3.16.4

@ruilinchu
Copy link

Same issue in 15.10-gnome

@aruth2
Copy link

aruth2 commented Apr 11, 2016

The workaround is to add
#include <xorg-server.h>
to the top of synproto.h

This let make finish without errors (but with warnings).

@Dev-Dipesh
Copy link

Dev-Dipesh commented May 26, 2016

Check your error message for file name and line number. In your case -

/usr/include/xorg/os.h:541:1:....

File - os.h
File Path - /usr/include/xorg/os.h
Line No - 541

Use your favourite text editor to open the file -

sudo vim /usr/include/xorg/os.h

So 541 is the line which is causing issue, comment it. Now you have to comment out line 540 too, why? The reason is it's a combined logic inside the if block as you can see in below:

#ifndef HAVE_STRNDUP <----- If block starts
extrn _X_EXPORT char * <----------- Comment out this line using // in front
strndup(const char *str, size_t n); <----------- Comment out this line using // in front
#endif <------ If blocks ends

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants