Jump to content

Compile source 64bit


Recommended Posts

Hello all,

 

I have a problem with compile source under 64bit freebsd..  I have all extern installed from repo but my source giving me error on end of compilation like a "incompatible libs like libthecore, mysqlclient" so I change flag in makefile "-m32"  to "-m64" this works like a charm.. But I have problem in game with packets..  Trying google and I search solution.. Problem is with long packets.. I have 2 possible solutions.. Change packets on server or client.. My question is.. What specifically I must change? And how correctly? Thanks for help!

Link to comment
Share on other sites

  • Developer

Hey, you only need to change 'long' to 'int32_t' in game source. (Would be better if you'd change the other types as well - e.g: byte -> uint8_t, short -> int16_t, etc)

For more informations you can check this link.

Edited by Finnis
  • Metin2 Dev 3
  • Love 2

r

Link to comment
Share on other sites

3 hours ago, Finnis said:

Hey, you only need to change 'long' to 'int32_t' in game source. (Would be better if you'd change the other types as well - e.g: byte -> uint8_t, short -> int16_t, etc)

For more informations you can check this link.

He needs to do that, but he needs to recompile / use the 64 bit equvivalent of the libs too.

And he needs to recompile metin2's libs like libthecore etc etc.

 

It's not as easy as it sounds if you ask me. Changing dependencies is always a shit ton of work / trial & error.

  • Love 1
Link to comment
Share on other sites

  • Developer
1 minute ago, Lead0b110010100 said:

He needs to do that, but he needs to recompile / use the 64 bit equvivalent of the libs too.

And he needs to recompile metin2's libs like libthecore etc etc.

 

It's not as easy as it sounds if you ask me. Changing dependencies is always a shit ton of work / trial & error.

Indeed, you're right, but from what he said I assumed that he already updated & compiled the libs.

  • Good 1
  • Love 1

r

Link to comment
Share on other sites

2 hours ago, Denizeri24 said:

i have a question, if you change all integers to 32 bit integers and build with -m64 flag, now server source was it really 64 bit ( ͡° ͜ʖ ͡°)

 

 

Question is not how to rewrite src on x64 but how to compile on x64 without jail.. Why? Just I travelling too much and I have only x64 vps.. (because low cost and low vps servers are not too much custom)  And where is my problem? Try to change all time working on new pc with virtualbox and some stuff.. I need go to on server from anyway in world.. I cant permanent download vdi or install new.. This is just easy way for me.. I only want NAT cloud server for my files + compile source..

Edit: Btw. Its a experiment just I welcome new knowledges about metin..

Edited by Cunoo
Link to comment
Share on other sites

42 minutes ago, Cunoo said:

Question is not how to rewrite src on x64 but how to compile on x64 without jail.. Why? Just I travelling too much and I have only x64 vps.. (because low cost and low vps servers are not too much custom)  And where is my problem? Try to change all time working on new pc with virtualbox and some stuff.. I need go to on server from anyway in world.. I cant permanent download vdi or install new.. This is just easy way for me.. I only want NAT cloud server for my files + compile source..

Edit: Btw. Its a experiment just I welcome new knowledges about metin..

 

actually this is not a experiment. i wont use extern;

 

CC = ccache clang++-devel

INCDIR =
LIBDIR = -L/usr/lib
BINDIR = ..
OBJDIR = OBJDIR

# Standard Setting
LIBS = -pthread -lm -lmd -lz
# Removed -fno-rtti 
CFLAGS = -m64 -std=gnu++2a -fstrict-aliasing -pipe -march=native -fexceptions -DNDEBUG -D_THREAD_SAFE -fstack-protector-all -w -g -Ofast

# Boost (1.7.2)
INCDIR += -I/usr/local/include/boost

# DevIL (1.7.8)
INCDIR += -I/usr/local/include/IL
LIBDIR += -L/usr/local/lib
LIBS += -lIL -lpng -ltiff -lmng -llcms -ljpeg

# MariaDB (10.5)
INCDIR += -I/usr/local/include
LIBDIR += -L/usr/local/lib/mysql
LIBS += -lmariadb

# Intel OneAPI TBB
INCDIR += -I/usr/local/include/oneapi
LIBDIR += -L/usr/local/lib
LIBS += -ltbb

# Project Library
INCDIR += -I../../liblua/include
LIBDIR += -L../../libthecore/lib -L../../libpoly -L../../libsql -L../../libgame/lib -L../../liblua/lib
LIBS += -lthecore -lpoly -llua -llualib -lsql -lgame

 

 

if you want build your server with -m64 flag, you need to change some source codes. but if you want your src -m32 flag with amd64 freebsd, just use make command with -m32 flag;

 

just add your /etc/make.conf;

 

CFLAGS = -m32

 

i dont test this command but maybe it works;

CPUTYPE = -march=i686

 

 

now, just use make install command;

 

 

putty >> whereis devil

 

output >> any/where/devil

 

cd any/where/devil

 

make install

 

now you have 32 bit devil library.

 

 

WARNING: if you use freebsd 11+, your default compiler llvm(clang), edit make.conf and put:

 

CC = gcc49 or g++10

CXX = g++49 or g++10

 

  • Love 1
Link to comment
Share on other sites

24 minutes ago, Denizeri24 said:

 

actually this is not a experiment. i wont use extern;

 


CC = ccache clang++-devel

INCDIR =
LIBDIR = -L/usr/lib
BINDIR = ..
OBJDIR = OBJDIR

# Standard Setting
LIBS = -pthread -lm -lmd -lz
# Removed -fno-rtti 
CFLAGS = -m64 -std=gnu++2a -fstrict-aliasing -pipe -march=native -fexceptions -DNDEBUG -D_THREAD_SAFE -fstack-protector-all -w -g -Ofast

# Boost (1.7.2)
INCDIR += -I/usr/local/include/boost

# DevIL (1.7.8)
INCDIR += -I/usr/local/include/IL
LIBDIR += -L/usr/local/lib
LIBS += -lIL -lpng -ltiff -lmng -llcms -ljpeg

# MariaDB (10.5)
INCDIR += -I/usr/local/include
LIBDIR += -L/usr/local/lib/mysql
LIBS += -lmariadb

# Intel OneAPI TBB
INCDIR += -I/usr/local/include/oneapi
LIBDIR += -L/usr/local/lib
LIBS += -ltbb

# Project Library
INCDIR += -I../../liblua/include
LIBDIR += -L../../libthecore/lib -L../../libpoly -L../../libsql -L../../libgame/lib -L../../liblua/lib
LIBS += -lthecore -lpoly -llua -llualib -lsql -lgame

 

 

if you want build your server with -m64 flag, you need to change some source codes. but if you want your src -m32 flag with amd64 freebsd, just use make command with -m32 flag;

 

just add your /etc/make.conf;

 

CFLAGS = -m32

 

i dont test this command but maybe it works;

CPUTYPE = -march=i686

 

 

now, just use make install command;

 

 

putty >> whereis devil

 

output >> any/where/devil

 

cd any/where/devil

 

make install

 

now you have 32 bit devil library.

 

 

WARNING: if you use freebsd 11+, your default compiler llvm(clang), edit make.conf and put:

 

CC = gcc49 or g++10

CXX = g++49 or g++10

 

Thanks for this info :D

Already use clang.. So my src is changed to clang.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.