• 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
Foundation with autoconf, automake, and libtool
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Foundation with autoconf, automake, and libtool


  • Subject: Foundation with autoconf, automake, and libtool
  • From: Kyle Moffett <email@hidden>
  • Date: Fri, 14 Nov 2003 19:46:13 -0500

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I am writing some GPL'd Objective-C software that makes use of the autotools, and
I was wondering what is the best way to link with the Foundation libraries, given
that I would like to later port this software to work with the GNUStep libraries.

Here is what I have done so far:



Relevant Makefile.am:
lib_LTLIBRARIES = libfinch.la

libfinch_la_LDFLAGS = -no-undefined -version-info 0:0:0 -framework Foundation
libfinch_la_LIBADD = -lobjc
libfinch_la_SOURCES = \
version.m



Relevant configure.ac:
dnl Find a C compiler
AC_PROC_CC

dnl This ugly hackery is here because of the lack of AC_PROG_OBJCC
_AM_DEPENDENCIES([OBJC])
OBJC=$CC
OBJCFLAGS=$CFLAGS
AC_SUBST([OBJC])
AC_SUBST([OBJCFLAGS])



The link fails as follows:
/bin/sh ../libtool --mode=link gcc -g -O2 -o libfinch.la -rpath /usr/local/lib -no-undefined -version-info 0:0:0 -framework Foundation version.lo -lobjc
gcc -dynamiclib -o .libs/libfinch.0.0.0.dylib .libs/version.o -lobjc - -install_name /usr/local/lib/libfinch.0.dylib -compatibility_version 1 - -current_version 1.0
ld: Undefined symbols:
.objc_class_name_NSObject
/usr/bin/libtool: internal link edit command failed
make[3]: *** [libfinch.la] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2



It appears that libtool is not passing the "-framework" option to gcc, so the link
fails due to missing symbols defined in Foundation.framework. I tried adding
"libfinch_la_CFLAGS = -framework Foundation" to my Makefile.am, but it didn't
help.



Cheers,
Kyle Moffett

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (Darwin)

iD8DBQE/tXdWag7LSGnFq10RAtMKAKCfDrESDk4hUJhBYOWPbO7OhflXvwCePIJU
yEj59JEAic666yYveVXKHKE=
=XsPB
-----END PGP SIGNATURE-----
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Foundation with autoconf, automake, and libtool (RESOLVED)
      • From: Kyle Moffett <email@hidden>
  • Prev by Date: Re: retain and autorelease
  • Next by Date: newbie: nil textfield
  • Previous by thread: Re: NSTextField getting input number by number
  • Next by thread: Re: Foundation with autoconf, automake, and libtool (RESOLVED)
  • Index(es):
    • Date
    • Thread