• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Linking external libraries
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Linking external libraries


  • Subject: Re: Linking external libraries
  • From: Sherm Pendley <email@hidden>
  • Date: Sat, 11 Dec 2004 23:40:29 -0500

On Dec 11, 2004, at 11:15 PM, Michael Mulligan wrote:

This is kind of a silly question, but I just can't get the darn thing to work and must be searching for the wrong thing in Google. I wrote a simple test program (fftwTest.c) to ensure I knew how to use FFTW correctly. I was able to build this using:

% gcc -lm -lfftw3 fftwTest.c

I then implemented what I needed in my xCode project, but now I don't have a clue how to make things link properly. I thought I could just click on my project (in the left), get info->Styles and add "fftw3" to Header Search Paths (I also did this for the active target). When I run my program though and attempt to run the FFTW-based code, surprise!

ZeroLink: unknown symbol '_fftw_malloc'

Any suggestions to get the linking to work? Thanks in advance for any assistance

Use Xcode's "Project/Add to Project ..." menu item to add the library to your app - you're looking for a file that's named "libfftw3", with an extension of "a" for a statically-linked library or "dylib" for a dynamic library. If you built and installed it from source, it's probably in /usr/local/lib/, if it came from Fink look in /sw/lib/. That should take care of linking.


The "Header Search Paths" setting you mentioned tells the compiler to search for headers when it finds an #include <foo.h>. Wherever you found the library, add the matching include/ subdir to the header search path - i.e. in the above examples it would be /usr/local/include/ or /sw/include/, respectively.

sherm--

Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Linking external libraries (From: Michael Mulligan <email@hidden>)

  • Prev by Date: Re: Adding controls to an NSScrollView in Interface Builder
  • Next by Date: Re: isEditable
  • Previous by thread: Linking external libraries
  • Next by thread: How to create a horizontal line for a separatorItem
  • Index(es):
    • Date
    • Thread