Results 1 to 10 of 10

Thread: Compiling format .so

  1. #1
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    458
    Thanks
    79
    Thanked 122 Times in 101 Posts

    Compiling format .so

    How to compile C++ files (.cpp, .hpp) at file libcod.so??

  2. #2
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    As written in README.md in https://github.com/kungfooman/libcod

    Working with the source / Compiling:

    Code:
    ./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:

    Code:
    ./doit.sh base
    ./doit.sh cod2_1_3
    Then the .so file is build as bin/libcod2_1_3.so
    timescale 0.01

  3. #3
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    458
    Thanks
    79
    Thanked 122 Times in 101 Posts
    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"
    Last edited by maxdamage99; 11th August 2015 at 14:01.

  4. #4
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    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.
    timescale 0.01

  5. #5
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    458
    Thanks
    79
    Thanked 122 Times in 101 Posts
    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

  6. #6
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    Quote Originally Posted by kung foo man View Post
    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?2...ll=1#post10702

  7. #7
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    458
    Thanks
    79
    Thanked 122 Times in 101 Posts
    Start server:
    Code:
    ================================
    > [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:
    Code:
    =================================
    
    ##### 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 ;(
    Last edited by Mitch; 11th August 2015 at 19:02. Reason: please post your code/output in code or php tags

  8. #8
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    Quote Originally Posted by maxdamage99 View Post
    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.
    PHP Code:
    ls -Z filename 
    https://access.redhat.com/documentat...Processes.html
    https://access.redhat.com/documentat...SELinux_Status
    Last edited by Mitch; 11th August 2015 at 19:01.

  9. #9
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    458
    Thanks
    79
    Thanked 122 Times in 101 Posts
    Info
    Code:
    -rwxr-xr-x root root ?                                libcod2_1_3.so
    SELinux status:                 disabled
    Last edited by maxdamage99; 11th August 2015 at 21:02.

  10. #10
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    458
    Thanks
    79
    Thanked 122 Times in 101 Posts
    Install Ubuntu 14.04
    Everything worked out!)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •