I moved from Archlinux to Kubuntu 12.04 yesterday.
I compiled buildroot 2012.08 on Archlinux without any problem. Though on Kubuntu libcrypt
seems to be broken. sysvinit
can't find it anywhere. glibc-dev
and all dependencies are installed.
How do I link to libcrypt
? Or, which package containts that library?
...
bc-gcc sulogin.o -o sulogin
sulogin.o: In function `main':
sulogin.c:(.text+0x49d): undefined reference to `crypt'
collect2: ld returned 1 exit status
Try adding '-lcrypt' after any objects used in linking; I've had a couple of instances where gcc would complain about crypt if -lcrypt wasn't near the end of the link list.
In other words, try something like:
as opposed to
undefined reference to 'crypt' is a linker error.
Try linking with -lcrypt :
gcc ....-lcrypt
For those of you using super-auto-magical CMAKE like me, try to add
to your CMakeLists.txt
Alternatively, replace PRIVATE for PUBLIC as needed..
If you have well established paths to libraries (e.g. all needed libs in /usr/lib), you may be fine with just stating in CMakeLists.txt:
set(CMAKE_CXX_FLAGS "-lcrypt")