Mailing Lists: Apple Mailing Lists

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

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



Greetings Comrades,

First of all, let me apologize if this posting belongs elsewhere, I am not a regular user. If this belongs on another list, let me know. Also, my problem involves Java, although I believe the Java element is not the main issue. (This is an update to a previous posting from several months ago. I have been busy with other aspects of the project, and this part has been lying fallow. Now it is getting in the way, and needs to be addressed.)


Here's the situation: I have a makefile that was used to build a shared library (a Java Native Interface library, to be specific). This makefile worked when I had Panther installed, but it broke when I upgraded to Tiger.



>>> begin makefile >>>

TARGET=../libJEngine.jnilib
OBJECTS=\
	JEngine_Model.o\
	JEngine_Parser.o\
#	>> more *.o files here <<
	engine/model.o\
	engine/imc.o

$(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


<<< end makefile <<<

The result of making this is...

>>> begin output >>>

ld: for architecture ppc
ld: Undefined symbols:
__ZN9__gnu_cxx18__exchange_and_addEPVii
__ZNSs4_Rep20_S_empty_rep_storageE
__ZNSs4_Rep9_S_createEmmRKSaIcE
__ZSt18_Rb_tree_decrementPSt18_Rb_tree_node_base
__ZSt28_Rb_tree_rebalance_for_erasePSt18_Rb_tree_node_baseRS_
__ZSt29_Rb_tree_insert_and_rebalancebPSt18_Rb_tree_node_baseS0_RS_
__ZNSt15_List_node_base4hookEPS_
__ZNSt15_List_node_base6unhookEv
__ZSt18_Rb_tree_incrementPSt18_Rb_tree_node_base
libtool: internal link edit command failed
make: *** [../libJEngine.jnilib] Error 1

<<< end output <<<


So, what is going on here? What are these symbols? Are they STL/ template symbols? (Do I care a lot? Not really, I just want this to work.)


My experiments with the makefile, including changing cc to gcc or g+ +, or trying to use glibtool instead of libtool, have been unsuccessful. I have tried setting my GCC version to use 3.3 instead of 4.0 (sudo gcc_select 3.3). No luck.

Is the GCC distribution broken? Is libtool the culprit, or is it gcc or ld? Are there any known fixes?

Where are these undefined symbols defined? Am I missing a library or a header, and if so, which one and how would I find out? (Even if the problem IS the GCC distribution, I am still curious how I would determine where to find the definitions of undefined symbols. Metrowerks supplies a "Find Library" facility which can be used to find symbols. Does GCC have something like that?)

(One thing that helped a lot was to use the Disk Utility.app to repair the file permissions on my drive. Before I did that (thanks to whoever suggested that, I forget where I saw it), libtool choked on the -llstdc++ -lc -lgcc section of the makefile, asserting that lstdc+ + and gcc were not found and could not be included. After fixing file permissions, that error went away. I think everyone should run fix permissions.)


_______________________________________________ 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


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.