This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: OSX shared libs: any ideas?




   The easy way to figure this out would be to create a library project 
in PB and see the command line it issues (by turning on the verbose 
build output preference).

   But, I believe you want like:

cc -dynamiclib *.o -o foo.dylib

   You may need to link some C++ library goo too (or maybe you can use 
-dynamiclib with c++).


-tim



On Saturday, September 15, 2001, at 03:18  PM, Jack Lloyd wrote:

> Hi,
>
> I know that Apple's version of gcc is not official and all that but this
> seems a reasonable place to ask, as IIRC some Apple people working on 
> the
> devel tools hang out here. This is MacOS X with the May 2001 Apple devel
> kit.
>
> Any thoughts on why this is happening:
>
> ---
> (sakura ~/OpenCL-0.7.5)$ c++ -shared -fPIC -lz <a list of object files> 
> -o libopencl-0.7.5.so
> /usr/bin/ld: Undefined symbols:
> _main
> ___builtin_delete
> ___eprintf
> ___pure_virtual
> ___rtti_si
> ___rtti_user
> ___throw
> _terminate__Fv
> ___check_eh_spec
> ___cp_pop_exception
> ___cp_push_exception
> ___eh_alloc
> ___start_cp_handler
> ___tf9exception
> ___ti9exception
> ___vt_9exception
> ___builtin_vec_delete
> ___builtin_vec_new
> ___builtin_new
> ___dynamic_cast
> ___lshrdi3
> ___ashldi3
> ___rtti_class
> ___udivdi3
> ___umoddi3
> restFP
> saveFP
>
> (sakura ~/OpenCL-0.7.5)$ c++ -v
> Reading specs from /usr/libexec/gcc/darwin/ppc/2.95.2/specs
> Apple Computer, Inc. version gcc-926, based on gcc version 2.95.2 
> 19991024 (release)
> ---
>
> 1) Linking these objects into an ar lib and linking my app will work 
> fine
> 2) This hasn't happened to me before on any system, so I don't think 
> it's
> pilot error re using PIC or whatever
>
> 3) Unrelated: how the #@%@%^ do I set the soname with Apple's ld? Yes, 
> this
> has nothing at all to do with gcc, but while I'm here, why not?
>
> Thanks,
>
> Jack
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]