undefined reference to `readline' [duplicate]
问题 This question already has answers here : 'undefined reference' errors when compiling against library (2 answers) Closed 6 years ago . I'm having a problem trying to run the GNU Readline library sample code available in wikipedia. Here it goes: #include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <readline/readline.h> #include <readline/history.h> int main() { char* input, shell_prompt[100]; // Configure readline to auto-complete paths when the tab key is hit. rl_bind_key('\t',