Jump to content


Photo

39DLL for Linux


  • Please log in to reply
6 replies to this topic

#1 nick

nick

    GMC Member

  • GMC Member
  • 24 posts

Posted 08 July 2012 - 05:33 AM

****ADDED DOWNLOAD TO PRE-COMPILED BINARIES 10/27/12****

***ADDED RUDIMENTARY ANDROID SUPPORT. PERFORMED SOME BASIC TESTING. APPEARS TO WORK.***

**Posted a fix to the build instructions below. BE SURE TO CHECK IT OUT AS IT FIXES THE LINKING PROCESS**

So i finally got tired of waiting for 39DLL to be ported, so i decided to do it myself. It hasn't been extensively tested but it should work. I have added instructions for building it in Ubuntu (and other Debian based OS's)

So without further ado, HERE is is

You can also just simply download the binaries from HERE if you don't want to compile. Again the lib has been tested with Ubuntu 10.04 and Android 4.0 so I cannot guarantee support for other operating systems (although, since I use POSIX interfaces, it SHOULD work without any issues on most distributions). The Android lib is compiled for Android Froyo (2.2) and above ONLY. If you need a version for an earlier Android, you'll need to compile it yourself. Just change the 'APP_PLATFORM' value in the Application.mk file and build. Consult THIS chart for an API (APP_PLATFORM) to Android version chart. (Although, if you need an earlier version, I think it's time to upgrade phones as Froyo is really the basic necessity for any real games anyway...)

**BUILD INSTRUCTIONS**

Complete instructions HERE

Linux Instructions:

1. Make sure build-essential AND g++ is installed.
2. Cd to the source directory
3. execute the following FOR EACH cpp file: g++ -fPIC -c -o obj/<INSERT CPP FILE NAME WITHOUT .CPP HERE>.o <INSERT CPP FILE NAME HERE>
so an example would be:
g++ -fPIC -c -o obj/main.o main.cpp

4. Then execute the following: g++ -shared obj/*.o -o 39dll-4-linux.so

And thats it! you have your .so linux shared library! As a note, you can also run ./make-linux and it'll run the commands for you!


Android instructions:

1. Make sure the NDK is installed and ndk-build is on your path. You will also require the Android SDK with its tools and platform -tools on your path
2. CD to the project root dir if you are not already there.
3. Simply execute the following command: ndk-build NDK_PROJECT_PATH=. NDK_APPLICATION_MK=Application.mk

And thats it! you have your .so Android shared library!

NOTE: If you get the following error: 'Android NDK: There is no Android.mk under ./jni' then you are in the wrong directory (probably android-src). MAKE SURE you are in the ROOT of the source tree


Please let me know how it works!


PS I'm working on getting it to build with Code::Blocks and also making a makefile. Please check back often with my GitHub as there will be patches, improvements, and better instructions there as I make them.

PPS The code is compatible with 39dylib and 39dll as it has the same method calls (i.e you use it the same way).

PPPS Forgot to add: Licensed under the Apache 2.0 license.

Happy Hacking!

Edited by nick, 27 October 2012 - 06:44 AM.

  • 0

#2 thijsmie

thijsmie

    GMC Member

  • GMC Member
  • 22 posts

Posted 03 August 2012 - 10:10 PM

Wow, that's great news! Android support was the only platform were multiplayer support for our game was missing! Thanks for creating this, I'll test it on my phone (Galaxy Ace Plus) and tablet (Eee Pad Transformer)... Do I really need linux to build it or can I import it into Visual studio or something? I'm not really sure how I would do that...

Thijsmie
  • 0

#3 nick

nick

    GMC Member

  • GMC Member
  • 24 posts

Posted 08 August 2012 - 03:32 PM

Wow, that's great news! Android support was the only platform were multiplayer support for our game was missing! Thanks for creating this, I'll test it on my phone (Galaxy Ace Plus) and tablet (Eee Pad Transformer)... Do I really need linux to build it or can I import it into Visual studio or something? I'm not really sure how I would do that...

Thijsmie



Well, you can build for Android on Windows using Cygwin and the Android SDK and NDK for windows, however, I highly recommend using Ubuntu or Debian and building there. As for the Linux version, you HAVE to build on Linux. Be sure to read the readme as detailed build instructions are included there.

If you just want the binaries, I will build them for you. I Need to know what version(s) of Android you are running. Go to Settings->About Phone to view the Android version. Post it here and Ill build it for you. The current setup is for 2.2.x (Froyo) and greater.

PS, If you wish to change the targeted Android version yourself, just change the 'APP_PLATFORM' value in the Application.mk file and build. Consult THIS chart for an API (APP_PLATFORM) to Android version chart.

Edited by nick, 10 October 2012 - 05:02 AM.

  • 0

#4 Crhonos

Crhonos

    GMC Member

  • GMC Member
  • 219 posts
  • Version:GM:Studio

Posted 24 October 2012 - 12:13 AM

Wiked tagged for latter, everyone needs to see this.
  • 0

#5 nick

nick

    GMC Member

  • GMC Member
  • 24 posts

Posted 27 October 2012 - 06:34 AM

Wiked tagged for latter, everyone needs to see this.


I appreciate the support my friend. Although there isn't a Game Maker for Linux, there is one for Android and you all could easily use this lib for a game there...
  • 0

#6 Crhonos

Crhonos

    GMC Member

  • GMC Member
  • 219 posts
  • Version:GM:Studio

Posted 30 October 2012 - 11:38 PM

Just to know, at now i can't use this for GMS android, because it does not support extensions right now, right? Or i can use it just by putting it in the same folder as the game and using "dll_init()" ?
  • 0

#7 nick

nick

    GMC Member

  • GMC Member
  • 24 posts

Posted 15 November 2012 - 06:10 AM

Just to know, at now i can't use this for GMS android, because it does not support extensions right now, right? Or i can use it just by putting it in the same folder as the game and using "dll_init()" ?


As far as I am aware dll_init should work, but I could be wrong (wouldnt be the first time in my life ;) )

Does anyone know the answer to this question?
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users