What's new

Welcome to Onforum.net - Web and gaming resource community

Join us now to get access to all our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, and so, so much more. It's also quick and totally free, so what are you waiting for?

Ask question

Ask Questions and Get Answers from Our Community

Answer

Answer Questions and Become an Expert on Your Topic

Contact Staff

Our Experts are Ready to Answer your Questions

Tutorial Compile source without requiring external dependencies

Blaze

Vip Plus
VIP Plus
Joined
Jan 28, 2019
Messages
250
Reaction score
1,608
Points
93
Credits
51
Many of you will have noticed that by compiling the source locally and then moving it to your server you receive error messages that relate to dependencies not found when trying to start the files.
For example:
Code:
Shared object "libmd.so.5" not found, required by "game"
To avoid going crazy trying to solve dependencies, we can simply include the necessary libraries directly in the game file.
To do this you need to edit the file called "Makefile" and add "-static" to the CFLAGS as shown below.
Code:
CFLAGS = -m32 -g -w -O2 -pipe -fexceptions -fno-strict-aliasing -pthread -D_THREAD_SAFE -DNDEBUG -static
The result will be that the compiled files already contain all the dependencies necessary for their operation and will be slightly heavier.
 
shape1
shape2
shape3
shape4
shape7
shape8
Top