• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Read this if you want to compile TFS with luajit under mingw

Fallen

Freelancer
Senator
Joined
Aug 21, 2009
Messages
3,712
Reaction score
249
Location
Egypt
Download: include + static lib(a) + dynamic lib(dll):
http://www.speedy*****malware.localhost/files/25886724/luajit.rar
Tutorial:
For Dev-cpp goto project -> Project options -> Parametres and replace "-llua5.1 -lluasql_mysql -lluasql_sqlite" with "-lluajit -lluajitsql_sqlite3.dll -lluajitsql_mysql.dll" and in C++ Compiler put "-D__LUAJIT__"
If you are using mingw32-make, please use this makefile:
Code:
CXX = g++
CXXINCLUDES = -I"." -I"C:/Dev-Cpp/include"
CXXFLAGS = $(CXXINCLUDES) -D__USE_MYSQL__ -D__USE_SQLITE__ -D__LUAJIT__ -D__CONSOLE__
LIBS = -L"C:/Dev-Cpp/lib" -lboost_regex -lboost_system -lboost_thread -lgmp -lluajitsql_sqlite3.dll -lluajitsql_mysql.dll -lluajit -lmysql -lsqlite3 -lwsock32 -lxml2 -lmysql -lws2_32 -s
RM = rm -f
EXECUTABLE = TheForgottenServer

SRC = otserv.cpp account.cpp actions.cpp admin.cpp allocator.cpp ban.cpp baseevents.cpp \
	beds.cpp chat.cpp combat.cpp commands.cpp condition.cpp configmanager.cpp connection.cpp \
	container.cpp creature.cpp creatureevent.cpp cylinder.cpp database.cpp databasemysql.cpp \
	databasesqlite.cpp depot.cpp exception.cpp fileloader.cpp game.cpp globalevent.cpp \
	gui.cpp house.cpp housetile.cpp inputbox.cpp ioguild.cpp iologindata.cpp iomap.cpp iomapserialize.cpp \
	item.cpp items.cpp logger.cpp luascript.cpp mailbox.cpp map.cpp md5.cpp monster.cpp monsters.cpp \
	mounts.cpp movement.cpp networkmessage.cpp npc.cpp outfit.cpp outputmessage.cpp party.cpp player.cpp \
	playerbox.cpp position.cpp protocol.cpp protocolgame.cpp protocollogin.cpp protocolold.cpp quests.cpp \
	raids.cpp rsa.cpp scheduler.cpp scriptmanager.cpp server.cpp sha1.cpp spawn.cpp spells.cpp \
	status.cpp talkaction.cpp tasks.cpp teleport.cpp textlogger.cpp thing.cpp tile.cpp tools.cpp \
	trashholder.cpp vocation.cpp waitlist.cpp weapons.cpp

OBJ = $(SRC:.cpp=.o)

.PHONY: all clean

all: $(SRC) $(EXECUTABLE)

$(EXECUTABLE): $(OBJ)
	$(CXX) $(OBJ) -o $@ $(LIBS)

clean:
	$(RM) $(OBJ) $(EXECUTABLE)

%.cpp: $(OBJ)
	$(CXX) $(CXXFLAGS) $< -o $@
If you have any questions, just ask in this thread
 
Last edited:
I am nub in this , but i donno if i use mingw32-make or no, how to know? anyway

i compile the 0.2.9 and gets this errors:
Code:
obj//status.o:status.cpp:(.text+0x8a2): undefined reference to `_imp__xmlFree'
obj//tools.o:tools.cpp:(.text+0xc88): undefined reference to `_imp__xmlFree'
obj//tools.o:tools.cpp:(.text+0xcca): undefined reference to `_imp__xmlFree'
obj//tools.o:tools.cpp:(.text+0xd15): undefined reference to `_imp__xmlFree'
obj//tools.o:tools.cpp:(.text+0x192c): undefined reference to `_imp__xmlFree'
obj//tools.o:tools.cpp:(.text+0x1994): more undefined references to `_imp__xmlFree' follow
collect2: ld returned 1 exit status

mingw32-make: *** [TheForgottenServer.exe] Error 1

Execution terminated
 
If your compiling with Dev-Cpp then your compiling with mingw, don't use the makefile unless you know what your doing, anyway check if you linked to -lxml2
 
ye it is there but having same error, i had a error for luajit but fixed after i made changes here, then i am getting this one
 
I swear I'm going to make a tutorial on transitioning from Dev-C++ to Eclipse or Code::Blocks. That poor dead horse is beaten flatter than The Great Plains =(

Regardless Rep++ for Minimal GCC for Windows and Lua JustInTime Compiler exposure. Are you providing 1.1.6, 2.0.0b5, or git HEAD libraries?
 
I am nub in this , but i donno if i use mingw32-make or no, how to know? anyway

i compile the 0.2.9 and gets this errors:
Code:
obj//status.o:status.cpp:(.text+0x8a2): undefined reference to `_imp__xmlFree'
obj//tools.o:tools.cpp:(.text+0xc88): undefined reference to `_imp__xmlFree'
obj//tools.o:tools.cpp:(.text+0xcca): undefined reference to `_imp__xmlFree'
obj//tools.o:tools.cpp:(.text+0xd15): undefined reference to `_imp__xmlFree'
obj//tools.o:tools.cpp:(.text+0x192c): undefined reference to `_imp__xmlFree'
obj//tools.o:tools.cpp:(.text+0x1994): more undefined references to `_imp__xmlFree' follow
collect2: ld returned 1 exit status

mingw32-make: *** [TheForgottenServer.exe] Error 1

Execution terminated

for me same error and i too have in linker -lxml2
 
I swear I'm going to make a tutorial on transitioning from Dev-C++ to Eclipse or Code::Blocks. That poor dead horse is beaten flatter than The Great Plains =(

Regardless Rep++ for Minimal GCC for Windows and Lua JustInTime Compiler exposure. Are you providing 1.1.6, 2.0.0b5, or git HEAD libraries?

+1 on changing Compiler and making a tutorial for such, I'm going to learn how to compile with MinGW32 and MinGW64 from Fallen and perhaps we might make a tutorial for them. Code::Blocks, I would really like to see a tutorial on that for compiling TFS.
 
Code::Blocks, I would really like to see a tutorial on that for compiling TFS.

What's so hard with installing libs lol. Just take your MinGW from Dev-Cpp and choose correct paths in CB? :p
 
Last edited:
Back
Top