Linux (SDL Probs... SOLVED)

BlitzMax Forums/Brucey's Modules/Linux (SDL Probs... SOLVED)

Dabhand(Posted 2015) [#1]
I've managed to build up bmx-ng on Linux, working grand, got MaxIDE to build and all that jazz, normal default Max2D applications work as expected... Though, I'm having a huge spot of bother with running the breakout sample, more notably, SDL, here's what I'm getting:-



OS: Linux Mint 17.2 Cinnamon 32bit
GCC: 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04)

Any ideas?

Oh, and a little thing, when running MaxIDE (NG), if I select "File->Open", then in the dialog click the $USER folder in the places section, it seg faults, like wise, even if I set the initial path to it, or even take a scenic route, as soon has I click that little directory called "michael", BANG, the IDE is gone?

No biggy, just wondering!

Cheers

Dabz


Derron(Posted 2015) [#2]
@user path

This happens to me with "InDevIDE"... which is written using wxmax.
Dunno if it too relies on a bmax function.

If you manually edit the path to be one directory deeper than "~/" it works.


Maybe we should try to compile maxide with debug ..


Dabhand(Posted 2015) [#3]

If you manually edit the path to be one directory deeper than "~/" it works



Local initPath:String = ""
?Linux
initPath:String = "~~/.."
?
path$=RequestFile(LocalizeString("{{request_openfile}}"),FileTypeFilters,False,initPath)


Worked a charm, cheers Derron! :)

Dabz


Dabhand(Posted 2015) [#4]
Is there an option to specify extra lib files in bmk?

So, if I want to add -lSDL2 or -lSDL etc etc to the commandline that builds it all (in the GCC call)... Where could I put it in the grand scheme of things?

I've tried 'Import " -lSDL[2]"', with no luck.

It's just about got me beat and I've battled with this all day! :/

Dabz


Dabhand(Posted 2015) [#5]
I'm getting a sneaky suspicion our Mr Henderson has seen these errors before! :)

Dabz


Derron(Posted 2015) [#6]
Next to "-lSDL2" there might be "-lSDL2main" "-lSDL2_image" and "-SDL2_mixer" and ...

But for now "-lSDL2" should be enough (and it is the only file I see in sdl.mod (sdl.mod/sdl.mod/lib/linuxx86/libSDL2.a)... in win32 you have this "libSDL2_main.a"...


----


Did you recompile the modules? If "bcc" changes, it is good to recompile all modules.


bye
Ron


Brucey(Posted 2015) [#7]
Apologies. There was a regression after updating to the latest SDL source.
It should be fixed now.


Dabhand(Posted 2015) [#8]
Champion... Tried it this morning and it was complaining dbus/dbus.h not found, so did a link to use usr/libs /dbus-1 and then it said something like "dbus/dbus.arch.something.h not found.

Just putting it out there, as I know there is a dbus.h file in the SDL/core, but for whatever reasons, it mustn't be able to see dbus.h in that folder, hence why I added a path to the one in my system and get the new error.

Never had time to investigate further, currently sitting on the pot at work wondering if the Taliban have better work loos then this! :D

Dabz


Dabhand(Posted 2015) [#9]
Note to self... Never ever touch DBus ever again! :/

Oh my god! :D

*VM Mint... Shredded*

Well, if at first you dont succeed...

Dabz


Dabhand(Posted 2015) [#10]
Right, new VM up and running, everything tasty... But cannot get rid of these DBus errors:-

Building breakout
[ 10%] Compiling:SDL_dbus.c
In file included from /home/michael/BlitzMax/mod/sdl.mod/sdl.mod/SDL/src/core/linux/SDL_dbus.h:30:0,
                 from /home/michael/BlitzMax/mod/sdl.mod/sdl.mod/SDL/src/core/linux/SDL_dbus.c:22:
/usr/include/dbus-1.0/dbus/dbus.h:29:33: fatal error: dbus/dbus-arch-deps.h: No such file or directory
 #include <dbus/dbus-arch-deps.h>
                                 ^
compilation terminated.
Build Error: failed to compile /home/michael/BlitzMax/mod/sdl.mod/sdl.mod/SDL/src/core/linux/SDL_dbus.c
Process complete


Apparently, the missing file should be in here: /usr/lib/dbus-1.0/include

But there's no directory in there at all, just one executable file in the dbus root folder called dbus-daemon-launch-helper which spits out "dbus-daemon-activation-helper service.to.activate" in the terminal when ran!

Any idea's because I havent got a single idea where you get this header from, and I've been package managering the arse off the thing! :D

Dabz


Dabhand(Posted 2015) [#11]
Right, for anyone else on Mint (32bit) that gets this, download the package here:-

http://packages.ubuntu.com/precise/i386/libdbus-1-dev/download

extract it, find the offending dbus-arch-deps.h file

Then, copy and paste it into your /usr/include/dbus-1.0/dbus directory (Will probably have to take ownership of that directory for a ickle bit to copy it across)

Not the sleekest of manoeuvres, and one which I really dont like doing (prefer to set everything up via apt-get, cos thats how I break things), but since this is the only way I've got it working, it'll have to do!

I'm just wondering why they neglected that header... Bit of a bollock dropped on their part?

Anyway, she's running, job done!

Dabz


Brucey(Posted 2015) [#12]
Is that a 64-bit Linux with 32-bit dev stuff?
If that is the case then I'd say - therein lies your issue ;-)

32-bit dev support on 64-bit Linux is getting worser, and in some cases you'll (webkitgtk comes to mind) struggle to have 32-bit and 64-bit dev packages installed at the same time.
Which is why I only do 64-bit apps on 64-bit Linux - which you can with NG now :-)
(for 32-bit builds and testing I have a 32-bit VM)


Derron(Posted 2015) [#13]
I am running 64bit Linux Mint and compiling 32bit apps with NG here - and am not having the trouble Dabhand "experiences".


bye
Ron


Brucey(Posted 2015) [#14]
YMMV :-p


Dabhand(Posted 2015) [#15]
Well, at least if the error crops up again there is a reason and a solution! :P

moral of the story... Don't rely on apt-get to install everything that a package advertises! :D

Dabz


Derron(Posted 2015) [#16]
In some scenarios you would rather "apt-get build-dep" than "apt-get install"...

http://askubuntu.com/questions/324845/whats-the-difference-between-apt-get-install-and-apt-get-build-dep


Let's see if I run into the same problem once I upgrade my Mint installation (am still on 17, not 17.2 - "cinnamon" is stated there, but running the XFCE variant)).


bye
Ron