(I'm not sure if "flag" is the word I'm looking for, but I'll explain it.)
I am trying to compile a program that uses the GMP big number library. But to be able to compile with GMP, I have to add -lgmp
to the end of the command. For example, if I want to compile "program.c", I have to type gcc program.c -lgmp
. This is easy from the command line, but I don't see how to do it in Xcode. How can I add the lgmp
flag while using Xcode?
Right-click the target in the Xcode Groups and Files list and select Get Info from the contextual menu. In the Build tab, type linker
into the search field and then locate the Other Linker Flags item.
Double-click the Other Linker Flags item and add -lgmp
.