From Bugzilla Helper: User-Agent: Mozilla/4.76 [en] (X11; U; Linux 2.4.2-2 i686) Description of problem: When compiling a c++ (not c) file with gcc, linker reports an error "undefined reference to `FascistCheck(char *, char *)' ". With .c files everything works as it should. How reproducible: Always Steps to Reproduce: 1. Create a simple c++ file (test.cpp) #include <stdio.h> #include <crack.h> main() { printf("%s",FascistCheck("12345","/usr/share/dict/cracklib_dict")); } 2. Try to compile it as: gcc -o test ./test.cpp -lcrack 3.Get an error - something like this: /tmp/cc02lWnO.o: In function `main': /tmp/cc02lWnO.o(.text+0x1e): undefined reference to `FascistCheck(char *, char *)' collect2: ld returned 1 exit status # 4. Rename file from test.cpp into test.c, compile and run it - everything works. Actual Results: in case of c++ file: /tmp/cc02lWnO.o: In function `main': /tmp/cc02lWnO.o(.text+0x1e): undefined reference to `FascistCheck(char *, char *)' collect2: ld returned 1 exit status in case of c file: #it is too short - (bad password) Expected Results: I excect it to work the way the c file works. Additional info:
crack.h does not surround the prototype with #ifdef __cplusplus extern "C" { #endif ... #ifdef __cplusplus } #endif Reassigning.
Fixing in cracklib-2.7-12, which will appear in the next Raw Hide refresh. Thanks!
Fix confirmed in cracklib-2.7-23.