• 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
Produce working, fat binary dynamic library from command line?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Produce working, fat binary dynamic library from command line?


  • Subject: Produce working, fat binary dynamic library from command line?
  • From: "mal content" <email@hidden>
  • Date: Mon, 11 Jun 2007 23:10:57 +0100

Hello.

I'm trying to produce working fat binary shared libraries
from the command line. I'm encountering linker errors.
Platform is PPC with a clean install of 10.4.9 (8.9.0) and
up-to-date developer tools.

I have the following files:

/* t.h */
#ifndef T_H
#define T_H

void t1(void);
void t2(void);
void t3(void);

#endif

/* t1.c */

#include <stdio.h>
#include "t.h"

void t1(void)
{
 printf("t1\n");
}

/* t2.c */

#include <stdio.h>
#include "t.h"

void t2(void)
{
 printf("t2\n");
}

/* t3.c */

#include <stdio.h>
#include "t.h"

void t3(void)
{
 printf("t3\n");
}

Makefile:

t.dylib: t.h t1.o t2.o t3.o
       libtool -dynamic -o t.dylib t1.o t2.o t3.o -lSystemStubs -lc

t1.o: t1.c t.h
       cc -arch i386 -arch ppc -isysroot
/Developer/SDKs/MacOSX10.4u.sdk -c -dynamic -o t1.o t1.c
t2.o: t2.c t.h
       cc -arch i386 -arch ppc -isysroot
/Developer/SDKs/MacOSX10.4u.sdk -c -dynamic -o t2.o t2.c
t3.o: t3.c t.h
       cc -arch i386 -arch ppc -isysroot
/Developer/SDKs/MacOSX10.4u.sdk -c -dynamic -o t3.o t3.c

clean:
       rm -f t.dylib t1.o t2.o t3.o

I'm getting this error:

$ make
cc -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -c
-dynamic -o t1.o t1.c
cc -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -c
-dynamic -o t2.o t2.c
cc -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -c
-dynamic -o t3.o t3.c
libtool -dynamic -o t.dylib t1.o t2.o t3.o -lSystemStubs -lc
ld: for architecture i386
ld: Undefined symbols:
_puts
libtool: internal link edit command failed
make: *** [t.dylib] Error 1

What is the correct way to produce shared libraries from
the command line in this manner? My method obviously
isn't right...

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


  • Follow-Ups:
    • Re: Produce working, fat binary dynamic library from command line?
      • From: "Andrew Pinski" <email@hidden>
  • Prev by Date: Re: WWDC Leopard Seed HW Compat?
  • Next by Date: Re: Produce working, fat binary dynamic library from command line?
  • Previous by thread: Re: WWDC Leopard Seed HW Compat?
  • Next by thread: Re: Produce working, fat binary dynamic library from command line?
  • Index(es):
    • Date
    • Thread