Jump to content
  • 0

Compile source 64bit


Cunoo

Question

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 post

9 answers to this question

Recommended Posts

  • 0
  • VIP
Posted (edited)

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
  • Love 1

r

Link to post
  • 0
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 post
  • 0
  • VIP
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.

  • Love 1
  • Good 1

r

Link to post
  • 0
1 hour ago, Finnis said:

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

Yes all internal libs are recompiled with x64 same as cryptopp and all other needed stuff.. + little changes in source..

  • Good 1
Link to post
  • 0

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 ( ͡° ͜ʖ ͡°)

 

 

Link to post
  • 0
Posted (edited)
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 post
  • 0
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 post
  • 0
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 post
  • 0
26 minutes ago, Cunoo said:

Thanks for this info :D

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

If you're done updating to llvm11 and 64 bit. Don't forget to play arounf with -fsanitizer. It works like a charm and helps me a lot!

  • Love 1
Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • 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.