1

I am a new user to both Unix and Xcode, so I apologize if this question is already discussed elsewhere. I am trying to use a third party algorithm database (NAG C Library) on my macbook, and in their user's manual I saw the following lines:

gcc driver.c -I[INSTALL_DIR]/include [INSTALL_DIR]/lib/libnagc_vl.dylib -framework vecLib -lpthread -lm

I understand that -I[INSTALL_DIR]/include is adding the directory into my header search path, but I have no idea what [INSTALL_DIR]/lib/libnagc_vl.dylib is doing since it doesn't seem to be an option. Also, what does -framework mean here?

Perhaps the most important question is how I can implement these options when I am trying to build the program in Xcode IDE? Sorry if this seems a lot of questions to answer... Thank you!

Vokram
  • 2,097
  • 4
  • 19
  • 27

1 Answers1

2

Consider that libnagc_vl.dylib in your "NAG C Library"; dylib means: "dynamic (or sharable) library" ( versus .a that is the self-contained library )

while the option

-framework framework

Links the executable being built against the listed framework. For example, you might add -framework vecLib to include support for vector math.

To get a full documentation of the compiler, in terminal you can type:

man gcc

In the answer of "Build Cocoa application Bundle with private dylib/framework" are enumerated the steps required to embed a framework in an application

Then to implement this options when you build the program you have to learn about "targets". A target contains the instructions for building a finished product from a set of files in your project; a way to learn this is from the help menu of Xcode type: target and gcc

These documents also could be of interest:

Community
  • 1
  • 1
Franco Rondini
  • 10,841
  • 8
  • 51
  • 77