Mam problem z kompilacją kodu źródłowego napisanego w C. Problem sprowadza się do nieodpowiedniej wersji posiadanego kompilatora. Program wymaga kompilatora nie nowszego niż gcc-3.3.4 i tu zaczyna się problem, bo ja posiadam nowszy kompilator. Moje pytanie jest następujące: czy jest możliwość "downgrade'u" kompilatora bez szkody dla jądra systemu, czy może jest jakaś możliwość aby "tymczasowo" użyć innego kompilatora?
Wszystkim z góry dziękuje za zainteresowanie i ewentualną pomoc
Dzięki za zainteresowanie . Kastagir, możesz jeszcze powiedzieć czy wystarczy paczkę kompilatora po ściągnięciu rozpakować i tyle? Czy jest jakaś specjalna procedura-rozpakowanie do odpowiedniego folderu etc.?
Zauważyłem teraz , że potrzebujesz gcc-3.3.4, a w II najstarszą wersją jest gcc-3.4. Jeśli nie zadziała na niej to problem może być trochę bardziej skomplikowany. Osobiście gdy miałem problemy w kompilacją nowszym gcc, używałem wersji 3.4 i zawsze udawało mi się problem rozwiązać.
Ok, zrobilem jak koledzy podpowiedzieliście (urzyłem zarównogcc-2.95 jak i 3.3) ale już podczas konfiguracji otrzymuję komunikaty świadczące o błędzie. Poniżej cały listing z configa (błędy zostały pogrubione):
checking for gcc... gcc-2.95
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc-2.95 accepts -g... yes
checking for gcc-2.95 option to accept ANSI C... none needed
checking whether we are using the GNU C++ compiler... no
checking whether gcc-2.95 accepts -g... no
checking how to run the C preprocessor... gcc-2.95 -E
checking for byacc... no
checking for yacc... no
checking for flex... no
checking for lex... no
checking for yywrap in -lfl... no
checking for yywrap in -ll... no
checking for ranlib... ranlib
checking for a BSD-compatible install... /usr/bin/install -c
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking whether byte ordering is bigendian... no
checking for inet_aton... yes
checking for inet_pton... yes
checking for inet_ntop... yes
checking for gethostbyname... no
checking for connect... no
checking how to run the C++ preprocessor... gcc-2.95 -E
checking for egrep... grep -E
checking for ANSI C header files... no
checking for sys/types.h... no
checking for sys/stat.h... no
checking for stdlib.h... no
checking for string.h... no
checking for memory.h... no
checking for strings.h... no
checking for inttypes.h... no
checking for stdint.h... no
checking for unistd.h... no
checking sstream usability... no
checking sstream presence... no
checking for sstream... no
checking whether in_pktinfo is needed... yes
checking whether struct sockaddr_in has sin_len... no
checking for 5th parameter of getsockopt... int
checking for 3rd parameter of getsockname... int
checking for 2nd parameter of recvfrom... char*
checking for 6th parameter of recvfrom... int
checking for 2nd parameter of sendto... char*
checking whether SO_REUSEPORT is defined... SO_REUSEADDR
checking for GNU make... make
checking for virtual networking... disabled
checking for real networking... enabled
checking for performance mode... disabled
checking pthread.h usability... no
checking pthread.h presence... yes
checking for pthread.h... yes
checking for pthread_mutex_init in -lpthread... no
checking for pthread_mutex_init in -lpthreads... no
checking for -pthreads linking option... "yes"
checking whether to compile checking mode... enabled
checking whether to compile logging mode... enabled
checking whether to compile api support... enabled
checking whether to compile java api support... disabled
checking whether to build interactive api client... disabled
checking whether to build testsuite... no
checking whether to build api clients... enabled
checking whether to build traffic generator... enabled
checking for refresh reduction... disabled
checking for onepass reservations... disabled
checking for inverse dns... disabled
checking whether to use scope object... enabled
checking whether to compile stats code... enabled
checking whether to use random timers... enabled
checking whether to use timers... enabled
checking whether to use fuzzy timers... disabled
checking whether to use memory optimization... enabled
checking for altq... disabled
checking for cbq... enabled
checking for mpls... enabled but not real
checking for dmalloc... disabled
configure: creating ./config.status
config.status: creating MakeConfig
config.status: creating Makefile
Grubby pisze:checking how to run the C++ preprocessor... gcc-2.95 -E,
wydaje mi się, że "-E" wskazuje na błąd, tym bardziej że nie mogę przeprowadzić kompilacji bez błędów.
Cytat z mana dla gcc:
-E Stop after the preprocessing stage; do not run the compiler proper. The output is in the form of preprocessed source code, which is sent to the standard output.
Ok, skoro konfiguracja jest ok, to może przedstawię przykładowe błędy podczas kompilacji, może ułatwi to zdiagnozowanie poblemu:
generic/BasicTypes.h:39:iostream No such file or directory
generic/BasicTypes.h:40:fstream No such file or directory
Brak nagłówków?
EDIT:
W związku z braku odpowiedzi na poprzedni post, mam pytanie: Czy jest ktoś, kto mógłby pomóc mi w kompilacji kodu, który posiadam? W razie potrzeby mogę go udostępnić na jakimś fileserverze lub podać bezpośredni link. Z góry dzięki za pomoc.
1. Masz zainstalowany pakiet build-essential?
2. Jak masz podać link, to podawaj od razu, a nie piszesz, jakby miało to znaczyć, że zrobisz łaskę, że komuś dasz link, jak będzie ci chciał pomóc (sorry, ale tak to niestety brzmi).