Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Libtool (ld) problem in makefile. Is the GCC 4.0 distribution broken?




On Dec 14, 2005, at 10:25 , Paul Archibald wrote:

$(TARGET): $(OBJECTS)
# this is the original libtool line
libtool -dynamic -M -single_module -o $@ $^ -lstdc++ -lc -lgcc > map
strip -x $@

%.o: %.cpp
# this is the original cc line
cc -c -O2 -o $@ $^ -I /System/Library/Frameworks/JavaVM.framework/ Headers


# I have tried this, too, with the same results
# g++ -c -O2 -o $@ $^ -I /System/Library/Frameworks/ JavaVM.framework/Headers

A couple of things spring to mind, although I'm not the expert here:

1) The "-I" can't have a space following it ("-I/...")

2) Don't use 'cc' to link (or, I think compile, but that may be handled by internal smarts) C++. Use 'c++' or 'g++' (the same thing). If you just pass 'cc' a bunch of .o's, it's got no clue what you want, so it treats the args as .o's compiled from 'c's, and links against the .c runtime.

Regards,

Justin

--
Justin C. Walker, Curmudgeon-At-Large
Institute for General Semantics
--------
Some people have a mental horizon of radius zero, and
call it their point of view.
  -- David Hilbert
--------


_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden
References: 
 >Libtool (ld) problem in makefile. Is the GCC 4.0 distribution broken? (From: Paul Archibald <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.