मैं हाइब्रिड ट्री (महत्वपूर्ण नहीं) के कार्यान्वयन की तलाश में हूं, और एक "पुराना" एक here ढूंढ रहा हूं।पुराने कंपाइलर के लिए लिखे गए प्रोग्राम को कैसे चलाया जाए?
लेखक ने कहा कि वे सूर्य SPARC मंच और जीसीसी-2.8.1 संकलक के साथ (सोलारिस 2.6 चल) पर इस कोड की कोशिश की है। और मेरा पर्यावरण जीसीसी संस्करण 4.4.3 (उबंटू 10.10) है।
समस्या है: मैं चलाने makefile वह प्रदान करता है के साथ "बनाना" है, लेकिन यह मुझे त्रुटि संदेश के बहुत सारे देता है इस प्रकार है:
g++ -c Node.C
g++ -c DataNode.C
In file included from DataNode.h:18,
from DataNode.C:17:
Query.h:9:20: error: vector.h: No such file or directory
Query.h:10:19: error: stack.h: No such file or directory
Query.h:13:22: error: function.h: No such file or directory
Query.h:14:22: error: iostream.h: No such file or directory
DataNode.C:283:8: warning: extra tokens at end of #endif directive
In file included from DataNode.h:18,
from DataNode.C:17:
Query.h:29: warning: ‘typedef’ was ignored in this declaration
Query.h:44: warning: ‘typedef’ was ignored in this declaration
Query.h:86: error: expected initializer before ‘<’ token
Query.h:118: error: ISO C++ forbids declaration of ‘PQ’ with no type
Query.h:118: error: expected ‘;’ before ‘*’ token
Query.h:122: error: ISO C++ forbids declaration of ‘PQ’ with no type
Query.h:122: error: expected ‘;’ before ‘*’ token
Query.h:126: error: ISO C++ forbids declaration of ‘PQ’ with no type
Query.h:126: error: expected ‘;’ before ‘*’ token
Query.h:135: error: expected initializer before ‘<’ token
DataNode.C: In member function ‘void DataNode::DisconnectBranch(int)’:
DataNode.C:80: error: ‘memmove’ was not declared in this scope
make: *** [DataNode.o] Error 1
मैं जानता हूँ कि मैं souce कोड संशोधित करना होगा करने के लिए के रूप में तो मॉर्डन कंपाइलर से सहमत हैं, जैसे vector.h
से vector
बदलें। लेकिन मुझे लगता है कि यह सिर्फ अंतहीन है।
तो मेरा सवाल यह है कि: इस प्रोग्राम को चलाने के लिए कोई दृढ़ तरीका है, चाहे इस कोड को "आधुनिक शैली" में परिवर्तित कर दिया जाए या स्टैंडअलोन "पुरानी शैली" कंपाइलर का उपयोग न करें?
कोई सुझाव?
=== अद्यतन: ===
आप सभी को धन्यवाद, मैं --prefix=/usr/local/gcc-2.8.1
का उपयोग कर और "makefile" संशोधित इस पुराने संस्करण जीसीसी (/usr/local/gcc-2.8.1/bin/gcc
) का उपयोग करने के लिए एक अलग निर्देशिका में gcc2.8.1 स्थापित। लेकिन जब मैं "बनाना" चलाने के लिए, यह अभी भी मुझे हेडर नहीं मिल की त्रुटियों देता है:
/usr/local/gcc-2.8.1/bin/gcc -c DataNode.C
In file included from DataNode.h:18,
from DataNode.C:17:
Query.h:9: vector.h: No such file or directory
Query.h:10: stack.h: No such file or directory
Query.h:11: deque: No such file or directory
Query.h:12: algorithm: No such file or directory
Query.h:13: function.h: No such file or directory
Query.h:14: iostream.h: No such file or directory
make: *** [DataNode.o] Error 1
तब मैं find /usr/local/gcc-2.8.1 -name "*vector*"
का उपयोग कर /usr/local/gcc-2.8.1 में इन प्रमुखों को खोजने के लिए कोशिश की, लेकिन कुछ भी नहीं मिला ।
तो पुराने संस्करण जीसीसी के लिए ये सिर कहां हैं?
उन्होंने विशेष रूप से शीर्षकों का नाम बदलने के अलावा अन्य समाधान के लिए कहा। –
प्लस, हेडर का नाम बदलना इसके अंत के करीब भी नहीं है। यदि आप उस मार्ग पर जाते हैं, तो आपको नामस्थानों के बारे में चिंता करने की भी आवश्यकता है - '' सबकुछ 'std' में रखता है, उदाहरण के लिए, जबकि' 'नहीं है। –
cHao