Skip to content

Compilation of ir fails because of wrong LDFLAGS and/or LIBRARIES #19

Description

@KlausMu
cd ir
make HOSTOS=LINUX

gives

[LINK]          ir
/usr/bin/ld: ../libs/Linux_x86_64/libflirc.a(hid.o): in function `hid_send_packet':
/home/kotzin/.buildkite-agent/builds/Linux-1/flirc-inc/sw-main/lib/libtransport/hid.c:144: undefined reference to `hid_write'
/usr/bin/ld: /home/kotzin/.buildkite-agent/builds/Linux-1/flirc-inc/sw-main/lib/libtransport/hid.c:150: undefined reference to `hid_error'
...

I think this is because of wrong LDFLAGS and/or LIBRARIES.

Don't know exactly where to fix this in Makefile or cross.mk

What is being called is

cc main.c -o ir -L. -Wl,--start-group -lhidapi-hidraw -lusb-1.0 -Wl,--end-group -lusb-1.0 -lflirc -lir -L../libs/Linux_x86_64 -Wall -g -std=c99 -I. -I../libs/include -Ideps/include

What should be called is

cc main.c -o ir -L. -Wl,--start-group -lhidapi-hidraw -lusb-1.0 -lusb-1.0 -lflirc -lir -Wl,--end-group -L../libs/Linux_x86_64 -Wall -g -std=c99 -I. -I../libs/include -Ideps/include

So the --start-group --end-group is wrong and needs to include all libs.
And -lusb-1.0 is used twice.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions