0

C++ プロジェクトで Tup を使い始めました。私の現在のものはゲームで、3つの部分に分かれています:

  • 1 つ目はメイン ディレクトリ「osumax」です。
  • 2 つ目は、私のゲーム フレームワーク「osumax/Libraries/ns_framework」です。
  • 最後はゲームデータのAPI「osumax/Libraries/osumax_shared」です。

現在、osumax_shared には何もありません。フレームワークに取り組んでいるためです。

ns_framework と osumax_shared は動的ライブラリです (私は Linux を使用しているため、.so ファイルがあります)。

libns_framework.so は警告なしでビルドされますが、メインの実行可能ファイルのビルドが開始されると、多くのエラーが発生し、未定義の参照のみが発生します。一部は ns_framework からのもので、理解できますが、TinyXML2 (apt-get でインストール) も使用しており、このライブラリからの未定義の参照が多数あります。

それは完全な出力です:

[ tup ] [0.000s] Scanning filesystem...
[ tup ] [0.130s] Reading in new environment variables...
[ tup ] [0.131s] Parsing Tupfiles...
 1) [0.001s] build-linux-x86_64-debug
 [ ] 100%
[ tup ] [0.136s] No files to delete.                                                                                                                           
[ tup ] [0.136s] Generating .gitignore files...
[ tup ] [0.265s] Executing Commands...
 1) [0.466s] build-linux-x86_64-debug: Compiling Sources/Main.cpp...                                                                                           
* 2) build-linux-x86_64-debug: g++ -L./Libraries/ -lns_framework -ltinyxml2 -lsfml-system -lsfml-window -lsfml-graphics -o ./osumax Objects/Main.o             
Objects/Main.o: In function `main':
/home/linkpy/Documents/Devel/C++/osumax/osumax/.tup/mnt/@tupjob-596/home/linkpy/Documents/Devel/C++/osumax/osumax/build-linux-x86_64-debug/Sources/Main.cpp:35: undefined reference to `tinyxml2::XMLDocument::XMLDocument(bool)'
/home/linkpy/Documents/Devel/C++/osumax/osumax/.tup/mnt/@tupjob-596/home/linkpy/Documents/Devel/C++/osumax/osumax/build-linux-x86_64-debug/Sources/Main.cpp:36: undefined reference to `ns::C_XmlObject::save(tinyxml2::XMLDocument&) const'
/home/linkpy/Documents/Devel/C++/osumax/osumax/.tup/mnt/@tupjob-596/home/linkpy/Documents/Devel/C++/osumax/osumax/build-linux-x86_64-debug/Sources/Main.cpp:36: undefined reference to `tinyxml2::XMLNode::InsertEndChild(tinyxml2::XMLNode*)'
/home/linkpy/Documents/Devel/C++/osumax/osumax/.tup/mnt/@tupjob-596/home/linkpy/Documents/Devel/C++/osumax/osumax/build-linux-x86_64-debug/Sources/Main.cpp:37: undefined reference to `tinyxml2::XMLDocument::Print(tinyxml2::XMLPrinter*)'
/home/linkpy/Documents/Devel/C++/osumax/osumax/.tup/mnt/@tupjob-596/home/linkpy/Documents/Devel/C++/osumax/osumax/build-linux-x86_64-debug/Sources/Main.cpp:35: undefined reference to `tinyxml2::XMLDocument::~XMLDocument()'
/home/linkpy/Documents/Devel/C++/osumax/osumax/.tup/mnt/@tupjob-596/home/linkpy/Documents/Devel/C++/osumax/osumax/build-linux-x86_64-debug/Sources/Main.cpp:35: undefined reference to `tinyxml2::XMLDocument::~XMLDocument()'
Objects/Main.o: In function `tinyxml2::XMLNode::FirstChildElement(char const*)':
/usr/include/tinyxml2.h:473: undefined reference to `tinyxml2::XMLNode::FirstChildElement(char const*) const'
Objects/Main.o: In function `tinyxml2::XMLElement::SetAttribute(char const*, char const*)':
/usr/include/tinyxml2.h:900: undefined reference to `tinyxml2::XMLElement::FindOrCreateAttribute(char const*)'
/usr/include/tinyxml2.h:900: undefined reference to `tinyxml2::XMLAttribute::SetAttribute(char const*)'
Objects/Main.o: In function `ns::C_XmlAbstractField::~C_XmlAbstractField()':
/home/linkpy/Documents/Devel/C++/osumax/osumax/.tup/mnt/@tupjob-596/home/linkpy/Documents/Devel/C++/osumax/osumax/build-linux-x86_64-debug/Libraries/ns_framework/Headers/ns/xml/C_XmlField.hpp:39: undefined reference to `vtable for ns::C_XmlAbstractField'
Objects/Main.o: In function `ns::C_XmlObject::C_XmlObject(std::string)':
/home/linkpy/Documents/Devel/C++/osumax/osumax/.tup/mnt/@tupjob-596/home/linkpy/Documents/Devel/C++/osumax/osumax/build-linux-x86_64-debug/Libraries/ns_framework/Headers/ns/xml/C_XmlObject.hpp:39: undefined reference to `vtable for ns::C_XmlObject'
Objects/Main.o: In function `Test::Test()':
/home/linkpy/Documents/Devel/C++/osumax/osumax/.tup/mnt/@tupjob-596/home/linkpy/Documents/Devel/C++/osumax/osumax/build-linux-x86_64-debug/Sources/Main.cpp:13: undefined reference to `ns::C_XmlObject::~C_XmlObject()'
Objects/Main.o: In function `ns::C_XmlAbstractField::C_XmlAbstractField()':
/home/linkpy/Documents/Devel/C++/osumax/osumax/.tup/mnt/@tupjob-596/home/linkpy/Documents/Devel/C++/osumax/osumax/build-linux-x86_64-debug/Libraries/ns_framework/Headers/ns/xml/C_XmlField.hpp:17: undefined reference to `vtable for ns::C_XmlAbstractField'
Objects/Main.o:(.data.rel.ro._ZTV4Test[_ZTV4Test]+0x20): undefined reference to `ns::C_XmlObject::load(tinyxml2::XMLDocument const&, tinyxml2::XMLElement const*)'
Objects/Main.o:(.data.rel.ro._ZTV4Test[_ZTV4Test]+0x28): undefined reference to `ns::C_XmlObject::save(tinyxml2::XMLDocument&) const'
Objects/Main.o: In function `Test::~Test()':
/home/linkpy/Documents/Devel/C++/osumax/osumax/.tup/mnt/@tupjob-596/home/linkpy/Documents/Devel/C++/osumax/osumax/build-linux-x86_64-debug/Sources/Main.cpp:9: undefined reference to `ns::C_XmlObject::~C_XmlObject()'
Objects/Main.o:(.data.rel.ro._ZTIN2ns10C_XmlFieldIiEE[_ZTIN2ns10C_XmlFieldIiEE]+0x18): undefined reference to `typeinfo for ns::C_XmlAbstractField'
Objects/Main.o:(.data.rel.ro._ZTI4Test[_ZTI4Test]+0x10): undefined reference to `typeinfo for ns::C_XmlObject'
Objects/Main.o: In function `ns::C_XmlField<int>::write(tinyxml2::XMLDocument&, tinyxml2::XMLElement*) const':
/home/linkpy/Documents/Devel/C++/osumax/osumax/.tup/mnt/@tupjob-596/home/linkpy/Documents/Devel/C++/osumax/osumax/build-linux-x86_64-debug/Libraries/ns_framework/Headers/ns/xml/C_XmlField.hpp:221: undefined reference to `tinyxml2::XMLDocument::NewElement(char const*)'
/home/linkpy/Documents/Devel/C++/osumax/osumax/.tup/mnt/@tupjob-596/home/linkpy/Documents/Devel/C++/osumax/osumax/build-linux-x86_64-debug/Libraries/ns_framework/Headers/ns/xml/C_XmlField.hpp:223: undefined reference to `tinyxml2::XMLDocument::NewText(char const*)'
/home/linkpy/Documents/Devel/C++/osumax/osumax/.tup/mnt/@tupjob-596/home/linkpy/Documents/Devel/C++/osumax/osumax/build-linux-x86_64-debug/Libraries/ns_framework/Headers/ns/xml/C_XmlField.hpp:223: undefined reference to `tinyxml2::XMLNode::InsertFirstChild(tinyxml2::XMLNode*)'
/home/linkpy/Documents/Devel/C++/osumax/osumax/.tup/mnt/@tupjob-596/home/linkpy/Documents/Devel/C++/osumax/osumax/build-linux-x86_64-debug/Libraries/ns_framework/Headers/ns/xml/C_XmlField.hpp:225: undefined reference to `tinyxml2::XMLNode::InsertEndChild(tinyxml2::XMLNode*)'
Objects/Main.o: In function `ns::C_XmlField<int>::read(tinyxml2::XMLElement const*)':
/home/linkpy/Documents/Devel/C++/osumax/osumax/.tup/mnt/@tupjob-596/home/linkpy/Documents/Devel/C++/osumax/osumax/build-linux-x86_64-debug/Libraries/ns_framework/Headers/ns/xml/C_XmlField.hpp:243: undefined reference to `tinyxml2::XMLNode::FirstChildElement(char const*) const'
/home/linkpy/Documents/Devel/C++/osumax/osumax/.tup/mnt/@tupjob-596/home/linkpy/Documents/Devel/C++/osumax/osumax/build-linux-x86_64-debug/Libraries/ns_framework/Headers/ns/xml/C_XmlField.hpp:250: undefined reference to `tinyxml2::XMLElement::GetText() const'
/home/linkpy/Documents/Devel/C++/osumax/osumax/.tup/mnt/@tupjob-596/home/linkpy/Documents/Devel/C++/osumax/osumax/build-linux-x86_64-debug/Libraries/ns_framework/Headers/ns/xml/C_XmlField.hpp:257: undefined reference to `tinyxml2::XMLElement::Attribute(char const*, char const*) const'
collect2: error: ld returned 1 exit status
 *** tup errors ***
 *** Command ID=598 failed with return value 1
tup error: Expected to write to file 'osumax' from cmd 598 but didn't
 *** Additionally, command 598 failed to process input dependencies. These should probably be fixed before addressing the command failure.
 [   ]  99%
 *** tup: 1 job failed.

リンク コマンドは次のとおりです。

g++ -L./Libraries/ -lns_framework -ltinyxml2 -lsfml-system -lsfml-window -lsfml-graphics -o ./osumax Objects/Main.o

ここに 2 つの Tup ファイルを示します (フランス語のコメントで申し訳ありません)。

では、これらのエラーは Tup ビルド システムによるものですか、それとも私によるものですか?

どこにエラーがあるのか​​ よくわかりません。または、何か間違ったことをした場合はtup構成です。

ご協力いただきありがとうございます !

4

0 に答える 0