Имею сервер на FreeBSD 8.0
Код: Выделить всё
free# pkg_info | grep lua
lua-5.1.4 Small, compilable scripting language providing easy access
lua51-luasocket-2.0.2 IPv4 Sockets support for the Lua language
free# lua
Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
> socket=require("socket")
> print(socket._VERSION)
LuaSocket 2.0.2
> os.exit()
Код: Выделить всё
free# cd /usr/home/hf
free# wget http://www.czdc.org/PtokaX/0.4.1.2-nix-src.tgz
free# tar zxvf 0.4.1.2-nix-src.tgz
free# cd PtokaX
free# cd tinyxml
free# wget http://downloads.sourceforge.net/project/tinyxml/tinyxml/2.5.3/tinyxml_2_5_3.tar.gz
free# tar -zxvf tinyxml_2_5_3.tar.gz
free# mv -R /usr/home/hf/PtokaX/tinyxml/tinyxml/* /usr/home/hf/PtokaX/tinyxml
free# pwd
/usr/home/hf/PtokaX/tinyxml
free# gmake
free# cd ..
free# pwd
/usr/home/hf/PtokaX
Код: Выделить всё
6. Because FreeBSD have some different things related to lua library we need to make three moddifications to makefile.
Search for this line:
INCLUDE = -Itinyxml/src -I/usr/include -I/usr/local/include -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1
And change it to:
INCLUDE = -Itinyxml/src -I/usr/include -I/usr/local/include -I/usr/local/include/lua51 -I/usr/include/lua5.1 -I/usr/pkg/include -I/usr/include/lua -I/usr/include/lua/5.1
Search for this line:
$(CXX) -lpthread -lz -llua5.1 -lrt -o PtokaX \
And change it to:
$(CXX) -lpthread -lz -lrt -o PtokaX \
Search for this line:
$(CURDIR)/tinyxml/tinyxml.a
And change it to:
$(CURDIR)/tinyxml/tinyxml.a /usr/local/lib/lua51/liblua.a
Но вот при попытке запустить какой-нибудь скрипт с использованием сокетов в логах скриптов ошибка
Код: Выделить всё
02.02.2010 19:46:38 - error loading module 'socket.core' from file '/usr/local/lib/lua/5.1/socket/core.so':
/usr/local/lib/lua/5.1/socket/core.so: Undefined symbol "lua_insert"