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

Compilation error for IR on ubuntu 17.10 #38

Closed
Pastim opened this issue Nov 26, 2017 · 4 comments
Closed

Compilation error for IR on ubuntu 17.10 #38

Pastim opened this issue Nov 26, 2017 · 4 comments

Comments

@Pastim
Copy link

Pastim commented Nov 26, 2017

Hi,
Having installed your own build of squeezelite from lms_clients (for which many thanks) I thought I'd had a go at compiling one myself with all the bells and whistles. All went fine except for IR. I have installed liblirc-dev 0.10.0-2, and my build line is:

OPTS="-DFFMPEG -DRESAMPLE -DVISEXPORT -DIR -DGPIO -DDSD -DLINKALL" make -B

The errors I get are all for LOG_DEBUG as below:

In file included from /usr/include/syslog.h:1:0,
from /usr/include/lirc/lirc_client.h:119,
from ir.c:28:
ir.c: In function ‘ir_key_map’:
ir.c:119:4: error: called object is not a function or function pointer
LOG_DEBUG("repeat suppressed");
^
ir.c: In function ‘ir_thread’:
ir.c:143:6: error: called object is not a function or function pointer
LOG_DEBUG("ir cmd: %s -> %x", c, ir_code);
^
ir.c:157:5: error: called object is not a function or function pointer
LOG_DEBUG("ir lirc: %s [%s] -> %x", b, r, ir_code);
^
ir.c:164:5: error: called object is not a function or function pointer
LOG_DEBUG("code dropped");
^
Makefile:87: recipe for target 'ir.o' failed
make: *** [ir.o] Error 1

After many experiments and searching, I found I could overcome this by changing ir.c to include squeezelite.h after lirc/lirc)client.h, as follows:

#if IR
#include <lirc/lirc_client.h>
#include "squeezelite.h"

I then get warnings as follows:

_In file included from ir.c:29:0:
squeezelite.h:397:0: warning: "LOG_INFO" redefined
#define LOG_INFO(fmt, ...) if (loglevel >= lINFO) logprint("%s %s:%d " fmt "\n", logtime(), FUNCTION, LINE, ##VA_ARGS)

In file included from /usr/include/syslog.h:1:0,
from /usr/include/lirc/lirc_client.h:119,
from ir.c:28:
/usr/include/x86_64-linux-gnu/sys/syslog.h:57:0: note: this is the location of the previous definition
#define LOG_INFO 6 /* informational */

In file included from ir.c:29:0:
squeezelite.h:398:0: warning: "LOG_DEBUG" redefined
#define LOG_DEBUG(fmt, ...) if (loglevel >= lDEBUG) logprint("%s %s:%d " fmt "\n", logtime(), FUNCTION, LINE, ##VA_ARGS)

In file included from /usr/include/syslog.h:1:0,
from /usr/include/lirc/lirc_client.h:119,
from ir.c:28:
/usr/include/x86_64-linux-gnu/sys/syslog.h:58:0: note: this is the location of the previous definition
#define LOG_DEBUG 7 /* debug-level messages */_

I assume that the version of liblirc on ubuntu 17.10, or the presence of some other library on my system, means that in your version of ir.c the definition of LOG_DEBUG from squeezelite.h is overridden by something in lirc/lirc_client.h.

I don't actually have IR on my system, so this is not a problem for me, but it might be for others in due course.

@ralph-irving
Copy link
Owner

Thank you for reporting this problem.
There's an outstanding pull request which fixes this #16
Unfortunately it breaks compilation on older linux distributions and renders most patches against the source useless which is why I haven't merged it.

@Pastim
Copy link
Author

Pastim commented Dec 11, 2017

OK - Thanks.

@ralph-irving
Copy link
Owner

Commit 33aa1d1 fixes the compilation issue with ir.c without changing most of the files in the squeezelite project.

@Pastim
Copy link
Author

Pastim commented Dec 19, 2017

Works for me. Thanks very much. What would we do without you and a handful of others on LMS?

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

2 participants