[Boost] Problem z kompilacją

Witam.

Na samym początku chciałbym dodać, że był już taki temat. Użytkownik, który szukał rozwiązania pomogła instalacja boost 1.4.5.

To może troche o moich umiejętnościach. :slight_smile:

Za dużo się tutaj nie rozpiszę ponieważ jeśli chodzi o kompilacje, programowanie itd. nie znam się lecz mimo to chciałbym skompilować serwer do gry, której nazwa jest wszystkim (a raczej większości) znana.

Dlaczego zakładam nowy temat skoro znalazłem odpowiedz na moje pytanie?

Dlatego, że poszukający odpowiedzi napisał, że pomogła instajacja boost 1.4.5 a ja nie wiem jak to zrobić.

Dobra może do rzeczy.

No więc tak.

Zaczołem moją prace w następujący sposób:

Na początek w /etc/apt zrobiłem nowy plik o nazwie apt.conf a w nim:

APT::Cache-Limit "12582912000";

Następnie w sources.list listę repozytoriów:

deb http://ftp.pl.debian.org/debian/ squeeze main non-free contrib
deb-src http://ftp.pl.debian.org/debian/ squeeze main non-free contrib
deb http://security.debian.org/ squeeze/updates main contrib non-free
deb-src http://security.debian.org/ squeeze/updates main contrib non-free
deb http://ftp.pl.debian.org/debian/ squeeze-updates main non-free contrib
deb-src http://ftp.pl.debian.org/debian/ squeeze-updates main non-free contrib

No i komenda:

apt-get update -o APT::Cache-Limit=12582912000

oraz

apt-get upgrade

Teraz tak jak podane w README źródła kompilacji:

apt-get install subversion autoconf automake make g++ libxml2 libxml2-dev libxml++2.6-dev lua5.1 liblua5.1-0 liblua5.1-0-dev libboost-dev libboost-date-time-dev libboost-regex-dev libboost-thread-dev libmysql++-dev libgmp3-dev liblua5.1-sql-mysql2 liblua5.1-sql-sqlite2 liblua5.1-sql-mysql-dev liblua5.1-sql-sqlite-dev libsqlite3-dev

wget http://heanet.dl.sourceforge.net/sourceforge/asio/boost_asio_1_4_7.tar.gz
               tar -xf boost_asio_1_4_7.tar.gz
                    cp -ar boost_asio_1_4_7/boost/* /usr/include/boost/
                     g++ boost_asio_1_4_7/libs/system/src/error_code.cpp -c -o /usr/lib/libboost_system.a

Przejście do katalogu z source /root/serwer oraz komenda:

make

Kompilacja ruszyła pełną parą przez… jakieś 2 sekundy. Po czym ukazało się coś takiego:

In file included from /usr/include/boost/asio/detail/impl/throw_error.ipp:21,
from /usr/include/boost/asio/detail/throw_error.hpp:52,
from /usr/include/boost/asio/detail/impl/posix_mutex.ipp:23,
from /usr/include/boost/asio/detail/posix_mutex.hpp:73,
from /usr/include/boost/asio/detail/mutex.hpp:25,
from /usr/include/boost/asio/detail/service_registry.hpp:20,
from /usr/include/boost/asio/impl/io_service.hpp:18,
from /usr/include/boost/asio/io_service.hpp:684,
from /usr/include/boost/asio/basic_io_object.hpp:20,
from /usr/include/boost/asio/basic_socket.hpp:19,
from /usr/include/boost/asio/basic_datagram_socket.hpp:20,
from /usr/include/boost/asio.hpp:20,
from connection.h:25,
from admin.cpp:24:
/usr/include/boost/system/system_error.hpp:22: error: expected initializer before ':' token
In file included from /usr/include/boost/asio/impl/io_service.hpp:18,
from /usr/include/boost/asio/io_service.hpp:684,
from /usr/include/boost/asio/basic_io_object.hpp:20,
from /usr/include/boost/asio/basic_socket.hpp:19,
from /usr/include/boost/asio/basic_datagram_socket.hpp:20,
from /usr/include/boost/asio.hpp:20,
from connection.h:25,
from admin.cpp:24:
/usr/include/boost/asio/detail/service_registry.hpp:38: error: expected '}' before end of line
/usr/include/boost/asio/detail/service_registry.hpp:38: error: expected '}' before end of line
/usr/include/boost/asio/detail/service_registry.hpp:38: error: expected declaration before end of line
make: *** [admin.o] Error 1

I w tym momencie zatrzymałem się przez kilka dni. Ponieważ szukam odpowiedzi lecz nie znalazłem.

Plik README jeśli ktoś by potrzebował:

]

[ CREDITS
	First of all, credits goes to the following OpenTibia developers for the server
	code base (SourceForge.net usernames, in alphabetical order):
		acidgame, jiddo, mips_act, nfries88, otserv_simone, primer13r,
		remere, shivoc, smygflik, snack, tliffrag and wrzasq.

	The rest of the credits goes to following The Forgotten Server developers:
		Talaturen
			Project Manager
			C++ Programmer
			Lua Scripter
			Data Directory Manager
			Founder

		Kornholijo
			C++ Programmer

		Elf
			C++ Programmer

		Fallen
			C++ Programmer
]

[ LICENSE
	This project is licensed under GPLv3, you should have received a copy
	of this license with this project.
]

[ FORUM
	Mainly english; with native chatboards for some other languages:
		http://otland.net/
]

[ SUPPORT
	Having trouble with any of the instructions, or is there
	anything you just want to ask?
		Create a new thread and ask here:
			http://otland.net/f55/
]

[ DONATIONS
	We are not really accepting donations to the project,
	but feel free to donate to the forum we're hosted at
	for higher priority support and other benefits:
		http://otland.net/payments.php
]

[ BUGS & FEATURE REQUESTS
	http://otland.net/project.php?projectid=2
]

[ COMPILING
	Linux
		Download required packages
			Debian \ Ubuntu
				Launch a terminal, and paste in this command:
					sudo apt-get install subversion autoconf automake make g++ libxml2 libxml2-dev libxml++2.6-dev lua5.1 liblua5.1-0 liblua5.1-0-dev libboost-dev libboost-date-time-dev libboost-regex-dev libboost-thread-dev libmysql++-dev libgmp3-dev liblua5.1-sql-mysql2 liblua5.1-sql-sqlite2 liblua5.1-sql-mysql-dev liblua5.1-sql-sqlite-dev libsqlite3-dev
					wget http://heanet.dl.sourceforge.net/sourceforge/asio/boost_asio_1_4_7.tar.gz
					tar -xf boost_asio_1_4_7.tar.gz
					sudo cp -ar boost_asio_1_4_7/boost/* /usr/include/boost/
					sudo g++ boost_asio_1_4_7/libs/system/src/error_code.cpp -c -o /usr/lib/libboost_system.a

			sudo: command not found
				If you're running Debian it's possible that you don't
				have sudo, if that's the case then you can run 'su' and
				you will have root access. Then execute the commands
				without 'sudo' in the beginning.

		Download sourcecode
			Launch a terminal, and paste in this command:
				svn co svn://svn.otland.net/public/forgottenserver/tags/0.2.10

		Compiling
			Launch a terminal, and type this command:
				cd 0.2.10/ && make

		Linker eror
			If you receive a linker error saying something with 'libboost',
			try pasting the following commands to terminal and then move back
			to compiling again:
				ln /usr/lib/libboost_regex-mt.so /usr/lib/libboost_regex.so && ln /usr/lib/libboost_regex-mt.a /usr/lib/libboost_regex.a && ln /usr/lib/libboost_thread-mt.so /usr/lib/libboost_thread.so && ln /usr/lib/libboost_thread-mt.a /usr/lib/libboost_thread.a

	Windows
		Dev-Cpp
			Download The Forgotten Dev-Cpp and the sources from:
				http://otland.net/showthread.php?t=1024

			Extract them anywhere and then run devcpp.exe, press on the
			menuitem "File -> Open Project or File" and choose:
				C:\path\to\source_code\dev-cpp\TheForgottenServer.dev.

			At this point Dev-Cpp should be running with the project,
			now you can hit:
				"Execute -> Rebuild All".

			After it get compiled, copy TheForgottenServer.exe from:
				C:\path\to\sources\dev-cpp to directory above (C:\path\to\source_code)
]

[ CONFIGURING
	Open config.lua with your favorite text editor and start configuring it,
	incase there are other things you would like to configure then go over
	to the data directory.
]

[ EXECUTING
	Linux
		MySQL
			Read MYSQL_HELP, and then launch a terminal, and paste in
			this command:
				cd ~/forgottenserver/forgottenserver/ && ./TheForgottenServer

		SqLite
			Launch a terminal, and paste in this command:
				cd ~/forgottenserver/forgottenserver/ && ./TheForgottenServer

	Windows
		MySQL
			Read MYSQL_HELP and then move the exe file to the directory
			where you have config.lua and data directory and execute it.

		SqLite
			Move the exe file to the directory where you have config.lua
			and data directory and execute it.
]

Jeśli ktoś wie jak naprawić błąd, prosze o pomoc :slight_smile:

System Linux Debian 6

Tak dziwnie się składa, że biblioteka Boost jest w repozytoriach: http://packages.debian.org/squeeze/libboost-dev

no tak ale ja potrzebuje boost 1.4.7 jak wynika z README. A tutaj są 1.4.2. Próbowałem sam boost

wget http://heanet.dl.sourceforge.net/sourceforge/asio/boost_asio_1_4_7.tar.gz
					tar -xf boost_asio_1_4_7.tar.gz
					cp -ar boost_asio_1_4_7/boost/* /usr/include/boost/
					g++ boost_asio_1_4_7/libs/system/src/error_code.cpp -c -o /usr/lib/libboost_system.a

Niestety kompilacja sie nie powiodła. Czyli repozytoria są potrzebne.

 

@edyt

A może są repozytoria z boost 1.4.7?

W repo dla Debiana 7 (obecny satble) jest w wersji

1.49.0.1

, więc możesz skorzystać z backportów, ewentualnie zaktalizować system.

Dziękuję za odpowiedz :slight_smile:

To serwer VPS i mam dostępny każdy Linux.

Lecz niestety debian 7 nie mam - work :confused:

Nie trzeba przeinstalowywać systemu. Wystarczy aktualizacja. Edytuj plik /etc/apt/sources.list:

nano /etc/apt/sources.list

Zamień wszystkie wyrazy ‘squeeze’ na ‘wheezy’. Zapisz i zamknij edytor (Crtl + X, potwierdź). Potem zaktualizuj listę pakietów:

aptitude update

a następnie zaktualizuj system:

aptitude upgrade && aptitude dist-upgrade

Uruchom ponownie system. Będziesz mieć Debiana 7.

Dzięki bardzo :slight_smile: Problem rozwiązany !!