Topic: Custom game plugin on LINUX?

Hi everyone . I have compiled a dll of SimpleGamePlugin under linux ubuntu using codeblocks. The name  of dll was libGame.so. I followed the tutorial of creating simple game plugin, but when i lounched the editor behavior was not visible. Actually it is not visible for any plugin(tried SimpleWaterDemo). Anyboady knows why? Is it working at linux at all?

Re: Custom game plugin on LINUX?

Hey Skywriter!

What Linux kernel are you using? A 32bit or 64bit kernel?

The precompiled Maratis version from the download page is 32bit afaik so you would have to recompile Maratis for 64bit and use the 64bit SDK. You could also compile your plugin with the -m32 flag.

Sponk

Re: Custom game plugin on LINUX?

Hi Sponk. My OS is 32 bit Ubuntu 13.04. I'm new to codeblocks and c++ programming. What this flag does and how can i set it? I checked codeblocks under build options/compiler flags, but didnt find such flag

Last edited by Skywriter (2013-08-28 13:06:32)

Re: Custom game plugin on LINUX?

the plugin needs to be named "Game.so".

Be also sure it's in your maratis project directory.

Re: Custom game plugin on LINUX?

Tried renaming libGame.so to Game.so and plugin is in the project directory with the .mproj file, but still nothing. Size of plugin is 238.3kb
I have uploaded the project here http://skywriter.freeoda.com/SimpleGamePlugin.zip If someone could check it, i would be gratelly thankfull.

Last edited by Skywriter (2013-08-29 16:06:01)

Re: Custom game plugin on LINUX?

did you build it in "release" mode ? ("debug" mode won't work)

Re: Custom game plugin on LINUX?

Compiled in both versions debug/release, named it Game.so and tried libGame.so, but its still the same... Thanks for correcting the link com3D. I took out the dot. It works now

Last edited by Skywriter (2013-08-29 16:05:41)

Re: Custom game plugin on LINUX?

Try to use the codeblocks project from this example : http://www.maratis3d.org/download/WaterGameDemo.zip
I don't have access to linux right now to test your file.

Some infos in case :
- don't use maratis source code from svn, just link to the headers of MCore and MEngine present with the release of Maratis you downloaded.
- don't compile MCore and MEngine, just link to it.
- compile in release
- name the plugin "Game.so" (not libGame.so)

Re: Custom game plugin on LINUX?

Did everything just as you said. Compiled WaterGameDemo with Game.so name, im using 32 bit OS Ubuntu linux, Maratis version is 3.21 also 32 bit, libraries and includes i used are from Maratis SDK folder, i did not compiled Maratis(just downloaded), used Codeblocks for compiler, compiled in Relese mode. Code is used from tutorial, nothing added - nothing removed, dll is in the same directory as .mproj. But still the same. Maybe i'm missing something...

Last edited by Skywriter (2013-08-29 17:52:36)

Re: Custom game plugin on LINUX?

Just thinking, maybe someone knows a proven way to compile it under Ubuntu linux using gcc without CodeBlocks. Can you post a command line to compile this project.

Re: Custom game plugin on LINUX?

Using Make & GCC

Create a "makefile" containing this code:

SRCS = $(wildcard *.cpp)
OBJS = $(SRCS:.cpp=.o) 
CFLAGS= -O2 -fPIC
LDFLAGS= -s -shared

#Set path to MSDK (MCore & MEngine from ../trunk/dev/)
INCLUDES = -I../SDK/MCore/Includes/ -I../SDK/MEngine/Includes/

all: $(OBJS)
    @g++ $(LDFLAGS) $(OBJS) -o ../Game.so

.cpp.o:
    @echo "( Compiling $^ )" # debug output
    @g++ $(CFLAGS) $(INCLUDES) -c -o $@ $^

NB: "@" lines are indented by a tabulation, not spaces

Instructions:
In your project folder (containg the .mproj file):
    - put a copy of the SDK folder (or use a symlink)
    - put the plugin sources+includes and the makefile into a new folder

Run the makefile using make.
The plugin is created in your project folder

Last edited by com3D (2013-10-11 12:27:02)

Re: Custom game plugin on LINUX?

Finally got it working! Makefile did it. Thanks a lot for your help guys

Had to change LDFLAGS= -shared -Wl to LDFLAGS= -shared -Wall. makefile reported error and put <tab> before all @

Last edited by Skywriter (2013-08-29 21:25:41)