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

The order of LDFLAGS for gcc #5

Open
hmgle opened this issue Jan 11, 2015 · 1 comment
Open

The order of LDFLAGS for gcc #5

hmgle opened this issue Jan 11, 2015 · 1 comment

Comments

@hmgle
Copy link

hmgle commented Jan 11, 2015

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
@zztczcx
Copy link

zztczcx commented Apr 28, 2015

I meet the same problem

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