I am a newbie to libhistory, so I was looking at the sample found with readline library. Compiled it on command prompt using:
gcc -o ./a.out /usr/local/share/readline/histexamp.c -lreadline -L/usr/local/lib/
It compiles and maintains history.
Then crated a xcode project with the same file and linked against readline library it compiles fine. But when I run , it won't maintain history and crashing while enumeration of history entries. After some trials i found that -isysroot argument is the cause for this problem:
-isysroot /Developer/SDKs/MacOSX10.6.sdk
The gcc man page says isysroot is like the --sysroot option, but applies only to header files.
Why the same program behaves differently with this option?
-isysroot is used to define the SDK that you build with. If you build with the 10.6 SDK and then try and run on OS X 10.5 then you will probably fail. You should build with whichever SDK corresponds to the minimum required OS for your program (for maximum backward-compatibility).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With