문제

I did upgrade my Ubuntu from 11.04 to 11.10. In 11.04 all this worked fine:

 gcc -fopenmp -g -c -o test.o test.c -I../include
 gcc -fopenmp -g -o test test.o -lnuma -lm -L../myLib -lmyL

but now, in 11.10, it gives the following errors:

 ../myLib/libmyL.a (get.o): In function 'get':
 get.c:(.text+0xa5): undefined reference to `mbind'

Where mbind is http://www.kernel.org/doc/man-pages/online/pages/man2/mbind.2.html

Plz can you help me to solve this problem? Or at least tell me what went wrong? Thanks.

도움이 되었습니까?

해결책

Move -lnuma to after your library in the link line this will help solve the dependency - because when you have it on the link line first the linker drops it because it doesn't need it as far as it knows so far.

Oh and in answer to your possible follow up question, yes you can create circular dependencies and No the they are not fun to fix :-)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top