We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2116 - Compile fails due to error in SDL_evdev.c
Summary: Compile fails due to error in SDL_evdev.c
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: HG 2.1
Hardware: All Linux
: P2 blocker
Assignee: Gabriel Jacobo
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-28 18:11 UTC by Joe LeVeque
Modified: 2013-09-28 22:18 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joe LeVeque 2013-09-28 18:11:04 UTC
There appears to be a copy/paste error at line 58 of SDL_evdev.c that causes the compile to fail.

The line:

static int SDL_EVDEV_device_added(const SDL_UDEV_deviceclass devclass, const char *devpath);

should probably read:

static int SDL_EVDEV_device_added(const SDL_EVDEV_deviceclass devclass, const char *devpath);
Comment 1 Joe LeVeque 2013-09-28 18:21:24 UTC
I posted this bug before looking into it very far. It appears not to be a copy/paste error because it is not only one line that presents this error, but many. It appears to be the case that if HAVE_LIBUDEV_H is not defined, SDL_UDEV_deviceclass is not defined, but SDL_evdev.c relies on it. The error is as follows:

SDL_evdev.c:58:1: error: unknown type name 'SDL_UDEV_deviceclass'
Comment 2 Gabriel Jacobo 2013-09-28 18:50:12 UTC
Let me know if this fixes it: http://hg.libsdl.org/SDL/rev/f06772125578

Thanks!
Comment 3 Joe LeVeque 2013-09-28 19:24:24 UTC
Looks like that took care of it.

Thanks for the prompt fix!
Comment 4 Joe LeVeque 2013-09-28 20:12:36 UTC
I believe this is related. Now when compiling SDL2_mixer, the configure script fails when trying to link against SDL2 with the following error:

test.c  -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lSDL2 -lpthread >&5
/usr/local/lib/libSDL2.so: undefined reference to `SDL_EVDEV_device_removed'
collect2: error: ld returned 1 exit status
configure:11530: $? = 1
configure: program exited with status 1

It appears that SDL_EVDEV_device_removed() is called at line 383 of SDL_evdev.c and is not enclosed within an "#if SDL_USE_LIBUDEV", hence the error.
Comment 5 Gabriel Jacobo 2013-09-28 22:18:15 UTC
Fixed: http://hg.libsdl.org/SDL/rev/0d425d6327d8