User Input Build Fail


#1

When I run the program that asks for input to print who is cool, the build fails. I get the question “Who is cool?”, but I can’t input anything and I get 2 errors which seem to be summarized in this message in Xcode

“Undefined symbols for architecture x86_64:
”_readline", referenced from:
_main in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)"

I am using the newest version of Xcode 5 and also included the readline/readline.h at the top. Any ideas why this isn’t working?


#2

Did you add the library that contains the definition of readline function to your project?

Including the header file is not sufficient; you also need to add the library to your project.


#3

That did the trick, thanks!