いくつかの.dylibs(プラグイン)をコンパイルしていて、それらにtinyxml2を静的に含めたいと思います。私は情報源の隣に座っていますtinyxml2.cpp
。tinyxml2.h
makeを実行すると、makeが生成するコマンドは次のとおりです。
rm -rf *.a *.os *.dylib
g++-4.0 -g -c -Werror -DUSE_GLEW -I/Applications/Nuke6.3v4/Nuke6.3v4.app/Contents/MacOS/include -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch x86_64 tinyxml2.cpp -o tinyxml2.a
g++-4.0 -g -c -Werror -DUSE_GLEW -I/Applications/Nuke6.3v4/Nuke6.3v4.app/Contents/MacOS/include -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch x86_64 -o SyGeo.os SyGeo.cpp
g++-4.0 -L/Applications/Nuke6.3v4/Nuke6.3v4.app/Contents/MacOS -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -arch x86_64 -bundle -lDDImage -lGLEW -framework QuartzCore -framework IOKit -framework CoreFoundation -framework Carbon -framework ApplicationServices -framework OpenGL -framework AGL -o SyGeo.dylib SyGeo.os
Undefined symbols:
"tinyxml2::XMLDocument::LoadFile(char const*)", referenced from:
SyDistorter::readPreset() in SyGeo.os
"tinyxml2::XMLDocument::~XMLDocument()", referenced from:
SyDistorter::readPreset() in SyGeo.os
SyDistorter::readPreset() in SyGeo.os
"tinyxml2::XMLElement::FindAttribute(char const*) const", referenced from:
tinyxml2::XMLElement::QueryFloatAttribute(char const*, float*) constin SyGeo.os
"tinyxml2::XMLNode::NextSiblingElement(char const*) const", referenced from:
tinyxml2::XMLNode::NextSiblingElement(char const*)in SyGeo.os
"tinyxml2::XMLDocument::XMLDocument(bool)", referenced from:
SyDistorter::readPreset() in SyGeo.os
"tinyxml2::XMLNode::FirstChildElement(char const*) const", referenced from:
tinyxml2::XMLNode::FirstChildElement(char const*)in SyGeo.os
"tinyxml2::XMLAttribute::QueryFloatValue(float*) const", referenced from:
tinyxml2::XMLElement::QueryFloatAttribute(char const*, float*) constin SyGeo.os
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [SyGeo.dylib] Error 1
リンクするにはどうすればよいですか?(私が構築しているすべての.dylibに、tinyxml2 libを静的に、できれば名前空間をマングリングして含めるようにします)。
ここでは古い10.5SDKを使用していることに注意してください。ホストアプリケーションが使用しているため、使用する必要があります。