Skip to content

The order of LDFLAGS for gcc #5

@hmgle

Description

@hmgle

Some version of gcc will ignore the linked Libraries if the -l options before the object files:

$ cc -Wall -Werror -lev -ggdb3 -I./include -o bin/unix-echo-server src/unix-echo-server.c obj/array-heap.o
ccVwfl0g.o: In function `ev_loop':
/usr/include/ev.h:826: undefined reference to `ev_run'

It is OK after moving the -lev to the end of the command:

$ cc -Wall -Werror -ggdb3 -I./include -o bin/unix-echo-server src/unix-echo-server.c obj/array-heap.o -lev

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions