PDA

View Full Version : Compiling format .so



maxdamage99
11th August 2015, 14:18
How to compile C++ files (.cpp, .hpp) at file libcod.so??

kung foo man
11th August 2015, 14:47
As written in README.md in https://github.com/kungfooman/libcod

Working with the source / Compiling:



./doit.sh tar
./doit.sh base # compiles object files needed by every .so
./doit.sh cod1_1_5 # compiles object files for CoD 1 1.5 and linking them against base to the actual bin/libcod1_1_5.so
./doit.sh cod2_1_2
./doit.sh cod2_1_3
./doit.sh cod4_1_7
./doit.sh wrapper


If you have CoD2 1.3 e.g. you do:



./doit.sh base
./doit.sh cod2_1_3


Then the .so file is build as bin/libcod2_1_3.so

maxdamage99
11th August 2015, 14:58
Start server error:
"Segmentation fault"

Compile error:
"/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../crti.o: could not read symbols: File in wrong format
collect2: ld returned 1 exit status"

kung foo man
11th August 2015, 15:18
No clue which part of the compiling toolchain is failing, maybe just go the easiest way and use e.g. Ubuntu 14.04.

If you really want to compile it on RedHat, debug the doit.sh step by step to figure out which command fails and fit it.

maxdamage99
11th August 2015, 15:25
Let me step by step instructions please
Maybe my paramentry VDS are not what you need :)
Tell me how to find out the exact details of my VDS
sry, very,very,very... bad english :(

Mitch
11th August 2015, 16:03
No clue which part of the compiling toolchain is failing, maybe just go the easiest way and use e.g. Ubuntu 14.04.

If you really want to compile it on RedHat, debug the doit.sh step by step to figure out which command fails and fit it.

CentOS is based on Red Hat. So try the instructions from this post: http://killtube.org/showthread.php?2036-Help-me-pls)))&p=10702&viewfull=1#post10702

maxdamage99
11th August 2015, 19:12
Start server:

================================
> [INFO] Compiled for: CoD2 1.3
Compiled: Aug 11 2015 21:17:17
> [INFO] value of closer=081141ba
> [INFO] value of download=0808f940
Segmentation fault
=================================
Use ./doit.sh wrapper:

=================================

##### WRAPPER: COMPILE wrapper_libcod2.cpp #####
cp: cannot stat `wrapper_libcod2.cpp': No such file or directory
gcc: a.cpp: No such file or directory
gcc: no input files
##### WRAPPER: LINK wrapper_libcod2.so #####
gcc: wrapper_libcod2.opp: No such file or directory
gcc: no input files
cp: cannot stat `wrapper_libcod2.so': No such file or directory
=================================
Help me guys ;(

Mitch
11th August 2015, 19:58
Start server:
================================
> [INFO] Compiled for: CoD2 1.3
Compiled: Aug 11 2015 21:17:17
> [INFO] value of closer=081141ba
> [INFO] value of download=0808f940
Segmentation fault
=================================

Help me guys ;(

Can you post the errors from 'dmesg' regarding the segmentation fault?
It might be because of SELinux which is enabled by default in Red Hat.

Can you also post the output of the following command for libcod2_1..so and your cod2 binary.

ls -Z filename

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Security-Enhanced_Linux/sect-Security-Enhanced_Linux-Targeted_Policy-Unconfined_Processes.html
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Security-Enhanced_Linux/chap-Security-Enhanced_Linux-Targeted_Policy.html#proc-How_to_Verify_SELinux_Status

maxdamage99
11th August 2015, 21:59
Info

-rwxr-xr-x root root ? libcod2_1_3.so
SELinux status: disabled

maxdamage99
12th August 2015, 13:55
Install Ubuntu 14.04
Everything worked out!)