Skip to main content

News

Topic: Sphere 1.5, 1.6 beta (Read 44697 times) previous topic - next topic

0 Members and 5 Guests are viewing this topic.
  • DaVince
  • [*][*][*][*][*]
  • Administrator
  • Used Sphere for, like, half my life
Re: Sphere 1.5, 1.6 beta
Reply #15

Are you using my version of Audiere?

Quote from: DaVince
didn't realize that was a separate thing in a separate Git.

= Yeah, I'm using your version of Audiere. Trying to compile that first, but it fails with the above. I'm not seeing any .so files or anything afterwards, either. (And if I don't need to compile Audiere itself, how can I at least let Sphere's build script know where it is? It doesn't seem to catch it when I clone that Git straight in sphere/audiere...)

Re: Sphere 1.5, 1.6 beta
Reply #16
I found that `make install` still threw the wxPlayer errors, but installed Audiere all the same. I did have to rename the installed audiere.so to audiere-1.9.4.so in usr/lib, though.

Strangely, I never could find Audiere's library without doing `make install`.

You can do a quick check (if you have scons, which you will need to build Sphere) to see if Audiere has been properly installed by putting this in a file called Sconstruct:
Code: (python) [Select]

import os
import sys
env = Environment(ENV=os.environ)
conf = Configure(env)
conf.CheckLib('audiere')

And running scons on it.

You'd still need to find the actual library and make a copy called 'audiere-1.9.4.so', but that would quickly tell you if `make install` worked on Audiere.
  • Last Edit: January 12, 2014, 09:06:30 am by Flying Jester

  • DaVince
  • [*][*][*][*][*]
  • Administrator
  • Used Sphere for, like, half my life
Re: Sphere 1.5, 1.6 beta
Reply #17
You're right; Audiere seems to have built. Perhaps it would be best to remove all instances of those wx files from your version of Corona.
Final step (I think): JS has compiled, but how do I make install or at least make Sphere aware where the js source is?

Re: Sphere 1.5, 1.6 beta
Reply #18
This is a little ugly, but it's the only easy way, it seems.

Copy all the header files from JS into /usr/local/include, and libjs.so directly into /usr/local/lib.


  • DaVince
  • [*][*][*][*][*]
  • Administrator
  • Used Sphere for, like, half my life
Re: Sphere 1.5, 1.6 beta
Reply #19
Getting closer...

Code: [Select]
scons: Reading SConscript files ...
os.name: posix
Using compiler: linux
Found sdl-config: /usr/bin/sdl-config
Using subsystem: unix
Found sdl-config: /usr/bin/sdl-config
Found wx-config: /usr/bin/wx-config
Found sdl-config: /usr/bin/sdl-config
Found sdl-config: /usr/bin/sdl-config
scons: done reading SConscript files.
scons: Building targets ...
g++ -o source/common/AnimationFactory.o -c -DNO_WRITE_MNG -DUNIX source/common/AnimationFactory.cpp
g++ -o source/common/DefaultFile.o -c -DNO_WRITE_MNG -DUNIX source/common/DefaultFile.cpp
g++ -o source/common/DefaultFileSystem.o -c -DNO_WRITE_MNG -DUNIX source/common/DefaultFileSystem.cpp
g++ -o source/common/Entities.o -c -DNO_WRITE_MNG -DUNIX source/common/Entities.cpp
g++ -o source/common/FLICAnimation.o -c -DNO_WRITE_MNG -DUNIX source/common/FLICAnimation.cpp
g++ -o source/common/Filters.o -c -DNO_WRITE_MNG -DUNIX source/common/Filters.cpp
g++ -o source/common/Font.o -c -DNO_WRITE_MNG -DUNIX source/common/Font.cpp
g++ -o source/common/Image32.o -c -DNO_WRITE_MNG -DUNIX source/common/Image32.cpp
g++ -o source/common/Layer.o -c -DNO_WRITE_MNG -DUNIX source/common/Layer.cpp
source/common/Layer.cpp: In copy constructor 'sLayer::sLayer(const sLayer&)':
source/common/Layer.cpp:59:72: error: 'memcpy' was not declared in this scope
         memcpy(m_Tiles, layer.m_Tiles, m_Width * m_Height * sizeof(int));
                                                                        ^
source/common/Layer.cpp: In member function 'const sLayer& sLayer::operator=(const sLayer&)':
source/common/Layer.cpp:99:76: error: 'memcpy' was not declared in this scope
             memcpy(m_Tiles, layer.m_Tiles, m_Width * m_Height * sizeof(int));
                                                                            ^
source/common/Layer.cpp: In member function 'void sLayer::Translate(int, int, int*, int, int)':
source/common/Layer.cpp:187:58: error: 'memcpy' was not declared in this scope
     memcpy(old_tiles, tiles, width * height * sizeof(int));
                                                          ^
scons: *** [source/common/Layer.o] Error 1
scons: building terminated because of errors.


While we're at it, what are the exact dependencies that Sphere needs in order to compile? Like the stuff that I need from Ubuntu's repositories, I mean?

Re: Sphere 1.5, 1.6 beta
Reply #20
You will need zlib, SDL (1.2, not 1.3 or 2.0), Corona and Audiere. I don't recall needing anything else, except for g++, scons, and python of course.

To fix that error (I'll push this change to the git repo), add to the top of Layer.hpp:

Code: (c++) [Select]

#include <cstring>


This is one of the examples of Sphere not being compiled by GCC in a while. In MSVC, it seems most of cstring is exposed by default.
  • Last Edit: January 16, 2014, 09:59:35 pm by Flying Jester

  • DaVince
  • [*][*][*][*][*]
  • Administrator
  • Used Sphere for, like, half my life
Re: Sphere 1.5, 1.6 beta
Reply #21
PackageFileSystem.hpp needed the same treatment.
Playlist.hpp needs #include <memory> and #include <stdio.h>.
configfile.hpp needs #include <memory>, #include <stdio.h>, #include <cstring>

Now it's stumbling over SDL, though... I seem to have all SDL1.2 dependencies, but... Google tells me this has something to do with the compile script, so dunno how to fix that.
Code: [Select]
scons: Reading SConscript files ...
os.name: posix
Using compiler: linux
Found sdl-config: /usr/bin/sdl-config
Using subsystem: unix
Found sdl-config: /usr/bin/sdl-config
Found wx-config: /usr/bin/wx-config
Found sdl-config: /usr/bin/sdl-config
Found sdl-config: /usr/bin/sdl-config
scons: done reading SConscript files.
scons: Building targets ...
g++ -o source/engine/engine source/engine/SpritesetServer.o source/engine/benchmark.o source/engine/engine.o source/engine/log.o source/engine/map_engine.o source/engine/render.o source/engine/rendersort.o source/engine/parameters.o source/engine/script.o source/engine/sfont.o source/engine/sfxr.o source/engine/simage.o source/engine/smap.o source/engine/sphere.o source/engine/ssfxr.o source/engine/sspriteset.o source/engine/swindowstyle.o source/engine/PlayerConfig.o -Lsource/common -Lsource/particle_engine -L/usr/lib/i386-linux-gnu -Lsource/engine/unix -lcommon -laudiere -lcorona -lmng -ljpeg -lz -lparticle_engine -lSDL -lunix -ldl -ljs
Install file: "system/scripts/colors.js" as "build/linux/system/scripts/colors.js"
Install file: "system/scripts/colorspace.js" as "build/linux/system/scripts/colorspace.js"
Install file: "system/scripts/convert.js" as "build/linux/system/scripts/convert.js"
Install file: "system/scripts/fademessage.js" as "build/linux/system/scripts/fademessage.js"
Install file: "system/scripts/graphics.js" as "build/linux/system/scripts/graphics.js"
Install file: "system/scripts/input.js" as "build/linux/system/scripts/input.js"
Install file: "system/scripts/intro.js" as "build/linux/system/scripts/intro.js"
Install file: "system/scripts/joysticks.js" as "build/linux/system/scripts/joysticks.js"
Install file: "system/scripts/layers.js" as "build/linux/system/scripts/layers.js"
Install file: "system/scripts/map_animation.js" as "build/linux/system/scripts/map_animation.js"
Install file: "system/scripts/math.js" as "build/linux/system/scripts/math.js"
Install file: "system/scripts/menu.js" as "build/linux/system/scripts/menu.js"
Install file: "system/scripts/named_parameters.js" as "build/linux/system/scripts/named_parameters.js"
Install file: "system/scripts/old_spriteset.js" as "build/linux/system/scripts/old_spriteset.js"
Install file: "system/scripts/oldsphere.js" as "build/linux/system/scripts/oldsphere.js"
Install file: "system/scripts/playlist.js" as "build/linux/system/scripts/playlist.js"
Install file: "system/scripts/screen.js" as "build/linux/system/scripts/screen.js"
Install file: "system/scripts/time.js" as "build/linux/system/scripts/time.js"
Install file: "system/scripts/timed_animation.js" as "build/linux/system/scripts/timed_animation.js"
Install file: "system/scripts/timer.js" as "build/linux/system/scripts/timer.js"
Install file: "system/scripts/wintro.js" as "build/linux/system/scripts/wintro.js"
Install file: "system/system.ini" as "build/linux/system/system.ini"
Install file: "system/system.rfn" as "build/linux/system/system.rfn"
Install file: "system/system.rws" as "build/linux/system/system.rws"
Install file: "system/up_arrow.png" as "build/linux/system/up_arrow.png"
g++ -o source/video_unix/sdl32/sdl32.os -c -DNO_WRITE_MNG -DUNIX -fPIC source/video_unix/sdl32/sdl32.cpp
g++ -o source/video_unix/sdl32/configfile.os -c -DNO_WRITE_MNG -DUNIX -D_GNU_SOURCE=1 -D_REENTRANT -fPIC -I/usr/include/SDL source/common/configfile.cpp
g++ -o source/video_unix/sdl32/defaultfile.os -c -DNO_WRITE_MNG -DUNIX -D_GNU_SOURCE=1 -D_REENTRANT -fPIC -I/usr/include/SDL source/common/DefaultFile.cpp
g++ -o source/video_unix/sdl32/defaultfilesystem.os -c -DNO_WRITE_MNG -DUNIX -D_GNU_SOURCE=1 -D_REENTRANT -fPIC -I/usr/include/SDL source/common/DefaultFileSystem.cpp
g++ -o source/video_unix/sdl_gl/sdl_gl.os -c -DNO_WRITE_MNG -DUNIX -fPIC source/video_unix/sdl_gl/sdl_gl.cpp
g++ -o source/video_unix/sdl_gl/configfile.os -c -DNO_WRITE_MNG -DUNIX -D_GNU_SOURCE=1 -D_REENTRANT -fPIC -I/usr/include/SDL source/common/configfile.cpp
g++ -o source/video_unix/sdl_gl/defaultfile.os -c -DNO_WRITE_MNG -DUNIX -D_GNU_SOURCE=1 -D_REENTRANT -fPIC -I/usr/include/SDL source/common/DefaultFile.cpp
g++ -o source/video_unix/sdl_gl/defaultfilesystem.os -c -DNO_WRITE_MNG -DUNIX -D_GNU_SOURCE=1 -D_REENTRANT -fPIC -I/usr/include/SDL source/common/DefaultFileSystem.cpp
g++ -o source/util/alphamerge/alphamerge.o -c -DNO_WRITE_MNG -DUNIX -Isource/common source/util/alphamerge/alphamerge.cpp
g++ -o source/util/chr2rss/chr2rss.o -c -DNO_WRITE_MNG -DUNIX -Isource/common source/util/chr2rss/chr2rss.cpp
source/engine/unix/libunix.a(unix_input.o): In function `UpdateSystem()':
unix_input.cpp:(.text+0x115b): undefined reference to `SDL_PollEvent'
source/engine/unix/libunix.a(unix_input.o): In function `SetMousePosition(int, int)':
unix_input.cpp:(.text+0x1409): undefined reference to `SDL_WarpMouse'
source/engine/unix/libunix.a(unix_input.o): In function `GetNumJoysticks()':
unix_input.cpp:(.text+0x1473): undefined reference to `SDL_NumJoysticks'
source/engine/unix/libunix.a(unix_input.o): In function `GetNumJoystickAxes(int)':
unix_input.cpp:(.text+0x1486): undefined reference to `SDL_NumJoysticks'
unix_input.cpp:(.text+0x14ad): undefined reference to `SDL_JoystickOpen'
unix_input.cpp:(.text+0x14c8): undefined reference to `SDL_JoystickNumAxes'
source/engine/unix/libunix.a(unix_input.o): In function `GetJoystickAxis(int, int)':
unix_input.cpp:(.text+0x14db): undefined reference to `SDL_NumJoysticks'
unix_input.cpp:(.text+0x150e): undefined reference to `SDL_JoystickOpen'
unix_input.cpp:(.text+0x1530): undefined reference to `SDL_JoystickGetAxis'
source/engine/unix/libunix.a(unix_input.o): In function `GetNumJoystickButtons(int)':
unix_input.cpp:(.text+0x155e): undefined reference to `SDL_NumJoysticks'
unix_input.cpp:(.text+0x1585): undefined reference to `SDL_JoystickOpen'
unix_input.cpp:(.text+0x15a0): undefined reference to `SDL_JoystickNumButtons'
source/engine/unix/libunix.a(unix_input.o): In function `IsJoystickButtonPressed(int, int)':
unix_input.cpp:(.text+0x15b3): undefined reference to `SDL_NumJoysticks'
unix_input.cpp:(.text+0x15da): undefined reference to `SDL_JoystickOpen'
unix_input.cpp:(.text+0x15fb): undefined reference to `SDL_JoystickNumButtons'
unix_input.cpp:(.text+0x1629): undefined reference to `SDL_JoystickGetButton'
source/engine/unix/libunix.a(unix_time.o): In function `GetTime()':
unix_time.cpp:(.text+0x7): undefined reference to `SDL_GetTicks'
collect2: error: ld returned 1 exit status
g++ -o source/util/image2map/image2map.o -c -DNO_WRITE_MNG -DUNIX -Isource/common source/util/image2map/image2map.cpp
scons: *** [source/engine/engine] Error 1
source/video_unix/sdl_gl/sdl_gl.cpp: In function 'bool InitVideo(int, int, std::string)':
source/video_unix/sdl_gl/sdl_gl.cpp:181:38: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
     SDL_putenv("SDL_VIDEO_CENTERED=1");
                                      ^
scons: building terminated because of errors.

Re: Sphere 1.5, 1.6 beta
Reply #22
I hate to say it, but are you sure you have the SDL development package, and not just the runtime?

  • DaVince
  • [*][*][*][*][*]
  • Administrator
  • Used Sphere for, like, half my life
Re: Sphere 1.5, 1.6 beta
Reply #23
I do, that's why I'm surprised! Installed SDL-related packages:
libalien-sdl-perl
libsdl-gfx1.2-4:i386
libsdl-gfx1.2-dev:i386
libsdl-image1.2:i386
libsdl-image1.2-dev:i386
libsdl-mixer1.2:i386
libsdl-net1.2:i386
libsdl-net1.2-dev:i386
libsdl-pango1:i386
libsdl-perl
libsdl-sound1.2:i386
libsdl-sound1.2-dev:i386
libsdl-ttf2.0-0:i386
libsdl-ttf2.0-dev:i386
libsdl1.2-dev
libsdl1.2debian:i386
libsdl2-2.0-0:i386
libsdl2-dev
mupen64plus-audio-sdl:i386
mupen64plus-input-sdl:i386

Re: Sphere 1.5, 1.6 beta
Reply #24
Strange, it worked as-is on my machine.

You could try adding
Code: (c++) [Select]

#include <SDL/sdl.h>


to the top of input.cpp, and possibly try changing the Sconscript file in source/engine/unix to:

Code: (python) [Select]

Import('base_env COMPILER')

env = base_env.Clone()
COMPILER.SetupSDL(env)

#This is new.
env.Append(LIBS = ['sdl'])

env.Library('unix', Split("""
    unix_audio.cpp
    unix_filesystem.cpp
    unix_input.cpp
    unix_network.cpp
    unix_screenshot.cpp
    unix_system.cpp
    unix_sphere_config.cpp
    unix_time.cpp
    unix_video.cpp
    unix_main.cpp
    """))


  • DaVince
  • [*][*][*][*][*]
  • Administrator
  • Used Sphere for, like, half my life
Re: Sphere 1.5, 1.6 beta
Reply #25
I couldn't find an input.cpp, just an input.hpp which seems to rely on unix_input.cpp. Either way I just get this:

Code: [Select]

source/engine/unix/unix_input.cpp:1:21: fatal error: SDL/sdl.h: No such file or directory

Re: Sphere 1.5, 1.6 beta
Reply #26
Right, that should actually be SDL/SDL.h, sorry.

  • DaVince
  • [*][*][*][*][*]
  • Administrator
  • Used Sphere for, like, half my life
Re: Sphere 1.5, 1.6 beta
Reply #27
Okay, there's a few less errors now, but those SDL-related ones are still there.

Code: [Select]

scons: Reading SConscript files ...
os.name: posix
Using compiler: linux
Found sdl-config: /usr/bin/sdl-config
Using subsystem: unix
Found sdl-config: /usr/bin/sdl-config
Found wx-config: /usr/bin/wx-config
Found sdl-config: /usr/bin/sdl-config
Found sdl-config: /usr/bin/sdl-config
scons: done reading SConscript files.
scons: Building targets ...
g++ -o source/engine/engine source/engine/SpritesetServer.o source/engine/benchmark.o source/engine/engine.o source/engine/log.o source/engine/map_engine.o source/engine/render.o source/engine/rendersort.o source/engine/parameters.o source/engine/script.o source/engine/sfont.o source/engine/sfxr.o source/engine/simage.o source/engine/smap.o source/engine/sphere.o source/engine/ssfxr.o source/engine/sspriteset.o source/engine/swindowstyle.o source/engine/PlayerConfig.o -Lsource/common -Lsource/particle_engine -L/usr/lib/i386-linux-gnu -Lsource/engine/unix -lcommon -laudiere -lcorona -lmng -ljpeg -lz -lparticle_engine -lSDL -lunix -ldl -ljs
source/engine/unix/libunix.a(unix_input.o): In function `UpdateSystem()':
unix_input.cpp:(.text+0x115b): undefined reference to `SDL_PollEvent'
source/engine/unix/libunix.a(unix_input.o): In function `SetMousePosition(int, int)':
unix_input.cpp:(.text+0x1409): undefined reference to `SDL_WarpMouse'
source/engine/unix/libunix.a(unix_input.o): In function `GetNumJoysticks()':
unix_input.cpp:(.text+0x1473): undefined reference to `SDL_NumJoysticks'
source/engine/unix/libunix.a(unix_input.o): In function `GetNumJoystickAxes(int)':
unix_input.cpp:(.text+0x1486): undefined reference to `SDL_NumJoysticks'
unix_input.cpp:(.text+0x14ad): undefined reference to `SDL_JoystickOpen'
unix_input.cpp:(.text+0x14c8): undefined reference to `SDL_JoystickNumAxes'
source/engine/unix/libunix.a(unix_input.o): In function `GetJoystickAxis(int, int)':
unix_input.cpp:(.text+0x14db): undefined reference to `SDL_NumJoysticks'
unix_input.cpp:(.text+0x150e): undefined reference to `SDL_JoystickOpen'
unix_input.cpp:(.text+0x1530): undefined reference to `SDL_JoystickGetAxis'
source/engine/unix/libunix.a(unix_input.o): In function `GetNumJoystickButtons(int)':
unix_input.cpp:(.text+0x155e): undefined reference to `SDL_NumJoysticks'
unix_input.cpp:(.text+0x1585): undefined reference to `SDL_JoystickOpen'
unix_input.cpp:(.text+0x15a0): undefined reference to `SDL_JoystickNumButtons'
source/engine/unix/libunix.a(unix_input.o): In function `IsJoystickButtonPressed(int, int)':
unix_input.cpp:(.text+0x15b3): undefined reference to `SDL_NumJoysticks'
unix_input.cpp:(.text+0x15da): undefined reference to `SDL_JoystickOpen'
unix_input.cpp:(.text+0x15fb): undefined reference to `SDL_JoystickNumButtons'
unix_input.cpp:(.text+0x1629): undefined reference to `SDL_JoystickGetButton'
source/engine/unix/libunix.a(unix_time.o): In function `GetTime()':
unix_time.cpp:(.text+0x7): undefined reference to `SDL_GetTicks'
collect2: error: ld returned 1 exit status
scons: *** [source/engine/engine] Error 1
scons: building terminated because of errors.


Now, here's the interesting thing:
Code: [Select]
g++ -o source/engine/engine source/engine/SpritesetServer.o source/engine/benchmark.o source/engine/engine.o source/engine/log.o source/engine/map_engine.o source/engine/render.o source/engine/rendersort.o source/engine/parameters.o source/engine/script.o source/engine/sfont.o source/engine/sfxr.o source/engine/simage.o source/engine/smap.o source/engine/sphere.o source/engine/ssfxr.o source/engine/sspriteset.o source/engine/swindowstyle.o source/engine/PlayerConfig.o -Lsource/common -Lsource/particle_engine -L/usr/lib/i386-linux-gnu -Lsource/engine/unix -lcommon -laudiere -lcorona -lmng -ljpeg -lz -lparticle_engine -lSDL -lunix -ldl -ljs

I've Googled the problem, and so far about five different forums state that if you put -lSDL at the very end instead of where it is now (4th last), that should fix things. I have no idea how to do that with a scons file, though.

Re: Sphere 1.5, 1.6 beta
Reply #28
To put -lSDL at the end:

Code: (python) [Select]

Import('base_env COMPILER')

env = base_env.Clone()
COMPILER.SetupSDL(env)

#This is new.
env.Append(LINKFLAGS = ' -lSDL ')

env.Library('unix', Split("""
   unix_audio.cpp
   unix_filesystem.cpp
   unix_input.cpp
   unix_network.cpp
   unix_screenshot.cpp
   unix_system.cpp
   unix_sphere_config.cpp
   unix_time.cpp
   unix_video.cpp
   unix_main.cpp
   """))

  • DaVince
  • [*][*][*][*][*]
  • Administrator
  • Used Sphere for, like, half my life
Re: Sphere 1.5, 1.6 beta
Reply #29
Well... Looks like that made no difference. Same output as before. I really have no clue why I can't compile - I have the libsdl1.2-dev and related source packages installed, after all!

Where does it try to look for SDL? Or is that done in an automated way? The only place I could locate SDL.h is /usr/include/SDL/SDL.h.