Sto cercando un'implementazione di Hybrid Tree (non importante) e trovo uno "vecchio" here.Come eseguire il programma scritto per il vecchio compilatore?
l'autore ha detto che hanno provato questo codice sulla piattaforma Sun SPARC (in esecuzione Solaris 2.6) e con gcc-2.8.1 compilatore. E il mio ambiente è versione gcc 4.4.3 (Ubuntu 10.10).
Il problema è: corro "fare" con il makefile egli fornisce, ma mi dà un sacco di messaggio di errore come segue:
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
so che ho bisogno di modificare il codice souce in modo da d'accordo con il compilatore morden, come ad esempio cambiare vector.h
a vector
. Ma trovo che sia infinito.
Quindi la mia domanda è: esiste un metodo conveniente per eseguire questo programma, non importa automaticamente la conversione di questo codice in "stile moderno" o utilizzando un compilatore "vecchio stile" autonomo?
Qualche suggerimento?
=== Aggiornamento: ===
Grazie a tutti, ho installato gcc2.8.1 in una directory diversa utilizzando --prefix=/usr/local/gcc-2.8.1
e modificare il "makefile" per utilizzare questa vecchia-versione di gcc (/usr/local/gcc-2.8.1/bin/gcc
). Ma quando ho eseguito "fare", mi dà ancora errori di non trovare le intestazioni:
/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
Poi ho cercato di trovare queste teste a /usr/local/gcc-2.8.1 utilizzando find /usr/local/gcc-2.8.1 -name "*vector*"
, ma ho niente .
Quindi, dove sono queste teste per la versione precedente di gcc?
Ha chiesto specificamente una soluzione oltre a rinominare le intestazioni. –
Inoltre, la ridenominazione delle intestazioni non è nemmeno prossima alla fine. Se segui questa strada, devi anche preoccuparti dei namespace - '' inserisce tutto in 'std', ad esempio, mentre' ' no. –
cHao