• 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: gcc -dymanic? or -shared?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gcc -dymanic? or -shared?


  • Subject: Re: gcc -dymanic? or -shared?
  • From: Chris Espinosa <email@hidden>
  • Date: Wed, 8 Feb 2006 12:37:51 -0800


On Feb 8, 2006, at 12:13 PM, email@hidden wrote:

I am trying to create a shared library. I have my library source and I can

compile it like:


gcc -c MySharedLibrary.c


then:


gcc -dynamic -o MySharedLibrary.dylib MySharedLibrary.o


then try to link a simple .c program against my library I get:


jason-t-slacks-power-mac-g4-agp-graphics:~/Desktop slack$ gcc -o myprog main.c

-L./ -lMySharedLibrary.dylib

/usr/bin/ld: can't locate file for: -lMySharedLibrary.dylib

collect2: ld returned 1 exit status


Can anybody explain why? everything is in the same directory.


Because if you want to use -l, the convention is that your library has to be named libMySharedLibrary.dylib.

Change the -o line in the gcc -dynamic invocation.

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

This email sent to email@hidden

  • Follow-Ups:
    • Re: gcc -dymanic? or -shared?
      • From: email@hidden
References: 
 >gcc -dymanic? or -shared? (From: email@hidden)

  • Prev by Date: gcc -dymanic? or -shared?
  • Next by Date: Re: gcc -dymanic? or -shared?
  • Previous by thread: gcc -dymanic? or -shared?
  • Next by thread: Re: gcc -dymanic? or -shared?
  • Index(es):
    • Date
    • Thread