Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: rbSFML  (Read 155348 times)

0 Members and 1 Guest are viewing this topic.

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Re: rbSFML
« Reply #225 on: April 24, 2012, 02:08:46 pm »
It went much further :)

Code: [Select]
Compiling ext/Audio/Music.cpp
ext/Audio/Music.cpp:117:23: error: cannot pass object of non-POD type 'sf::Time' through variadic function; call will abort at runtime
      [-Wnon-pod-varargs]
                      rbMacros::ToSFML< sf::Music >( aSelf, rbMusic::Class )->getDuration() );
                      ^
ext/Audio/Music.cpp:114:33: warning: conversion specifies type 'double' but the argument has type 'sf::Time' [-Wformat]
    return rb_sprintf( "%s(%p: %fs)",
                               ~^
1 warning and 1 error generated.
rake aborted!
Command failed with status (1): [/usr/bin/clang++ -pipe -O2 -Iinclude -Iext...]

Tasks: TOP => default => all => audio
(See full trace by running task with --trace)
Want to play movies in your SFML application? Check out sfeMovie!

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Re: rbSFML
« Reply #226 on: April 24, 2012, 02:17:02 pm »
I'm starting to like your compiler.. It's finding errors I've missed ^^

Alright let's try it out now.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Re: rbSFML
« Reply #227 on: April 24, 2012, 02:22:09 pm »
Code: [Select]
Compiling ext/Audio/SoundBuffer.cpp
ext/Audio/SoundBuffer.cpp:182:61: warning: conversion specifies type 'int' but the argument has type 'std::size_t' (aka 'unsigned long')
      [-Wformat]
        rb_raise( rb_eArgError, "expected array size to be %d", sampleCount );
                                                           ~^   ~~~~~~~~~~~
                                                           %lu
ext/Audio/SoundBuffer.cpp:288:23: error: cannot pass object of non-POD type 'sf::Time' through variadic function; call will abort at
      runtime [-Wnon-pod-varargs]
                      rbMacros::ToSFML< sf::SoundBuffer >( aSelf, rbSoundBuffer::Class )->getDuration() );
                      ^
ext/Audio/SoundBuffer.cpp:285:32: warning: conversion specifies type 'int' but the argument has type 'sf::Time' [-Wformat]
    return rb_sprintf("%s(%p: %ims)",
                              ~^
2 warnings and 1 error generated.
rake aborted!
Command failed with status (1): [/usr/bin/clang++ -pipe -O2 -Iinclude -Iext...]

Tasks: TOP => default => all => audio
(See full trace by running task with --trace)

Do you know that Clang isn't specific to Mac OS X ? You can give it a try quite easily on Linux. Dunno what about Windows.
Want to play movies in your SFML application? Check out sfeMovie!

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Re: rbSFML
« Reply #228 on: April 24, 2012, 02:30:50 pm »
Do you know that Clang isn't specific to Mac OS X ? You can give it a try quite easily on Linux. Dunno what about Windows.

Alright another try.

And I can't really right now because I am sitting at my workstation doing the changes over the Github web editor.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: rbSFML
« Reply #229 on: April 24, 2012, 02:34:17 pm »
Quote
Dunno what about Windows
Last time I tried (3.0.0), there were bugs that prevented it to work. And you have to build it yourself, there's no precompiled package.
Laurent Gomila - SFML developer

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Re: rbSFML
« Reply #230 on: April 24, 2012, 02:37:04 pm »
Code: [Select]
[ ceylo ceylo-pc ~/Desktop/rbSFML ] rake
Creating sfml/system.so
Creating sfml/window.so
Creating sfml/graphics.so
Compiling ext/Audio/SoundBuffer.cpp
Compiling ext/Audio/SoundBufferRecorder.cpp
Compiling ext/Audio/SoundRecorder.cpp
Compiling ext/Audio/SoundSource.cpp
Compiling ext/Audio/SoundStream.cpp
Creating sfml/audio.so
Compiling ext/all.cpp
Creating sfml/all.so
[ ceylo ceylo-pc ~/Desktop/rbSFML ]
:)

Yeah it's still under heavy development at the moment : http://clang.llvm.org/cxx_status.html
But I really love how clear the error messages are, compared to GCC.
Want to play movies in your SFML application? Check out sfeMovie!

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Re: rbSFML
« Reply #231 on: April 24, 2012, 02:49:51 pm »
Finally compiled :D
I am now Clang++ proof  8)

Let me know how writing actual ruby code goes. I hope it works out well :D
And most important, have fun coding. I think that's the most important aspect of Ruby. It makes coding really fun, fast and simple. And let me know if you feel that I disrupt and of the Ruby principles(if you know them).
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Re: rbSFML
« Reply #232 on: April 24, 2012, 02:53:55 pm »
I don't want to disappoint you but... my purpose was just to test someone else's game, not learn Ruby :D . At least, for now :) .


Edit: I tried this, without success :(
Code: [Select]
[ ceylo ceylo-pc ~/Desktop/rbSFML ] sudo rake install
Password:
Nothing to uninstall.
Installing library to /opt/local/lib/ruby1.9/site_ruby/1.9.1/x86_64-darwin11/sfml
Installing sfml/all.so...
Installing sfml/audio.so...
Installing sfml/graphics.so...
Installing sfml/system.so...
Installing sfml/window.so...
[ ceylo ceylo-pc ~/Desktop/rbSFML ] ls /opt/local/lib/ruby1.9/site_ruby/1.9.1/x86_64-darwin11/sfml
all.so audio.so graphics.so system.so window.so
[ ceylo ceylo-pc ~/Desktop/rbSFML ] rake test
Warning: Cannot load 'sfml/system'
Warning: Cannot load 'sfml/window'
Warning: Cannot load 'sfml/graphics'
Warning: Cannot load 'sfml/audio'
[ ceylo ceylo-pc ~/Desktop/rbSFML ] rake samples
/opt/local/bin/ruby1.9 sound.rb
/opt/local/lib/ruby1.9/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- sfml/system (LoadError)
from /opt/local/lib/ruby1.9/1.9.1/rubygems/custom_require.rb:36:in `require'
from sound.rb:7:in `rescue in <main>'
from sound.rb:4:in `<main>'
/opt/local/bin/ruby1.9 window.rb
/opt/local/lib/ruby1.9/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- sfml/system (LoadError)
from /opt/local/lib/ruby1.9/1.9.1/rubygems/custom_require.rb:36:in `require'
from window.rb:7:in `rescue in <main>'
from window.rb:4:in `<main>'

Can't rake test and rake samples be a bit more verbose about why sfml/system couldn't be loaded ?
« Last Edit: April 24, 2012, 02:58:32 pm by Ceylo »
Want to play movies in your SFML application? Check out sfeMovie!

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Re: rbSFML
« Reply #233 on: April 24, 2012, 02:59:24 pm »
I don't want to disappoint you but... my purpose was just to test someone else's game, not learn Ruby :D . At least, for now :) .



WAAARGHH!!!! *breaths heavily*
Let me guess, You are going to play Steel? :P

The test is not valid, just take my example script from a few pages back and test. Does that work then the game you are going to test will work.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Re: rbSFML
« Reply #234 on: April 24, 2012, 03:00:12 pm »
WAAARGHH!!!! *breaths heavily*
Let me guess, You are going to play Steel? :P
Yup I want to give it a try :D .

PS: I edited the above message.
Want to play movies in your SFML application? Check out sfeMovie!

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Re: rbSFML
« Reply #235 on: April 24, 2012, 03:01:21 pm »
Test and samples are out of date so don't trust them. I should just have them removed really as it confuses people. Take the test script from a couple of pages back on this thread and if that one runs the game runs ;)
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Re: rbSFML
« Reply #236 on: April 24, 2012, 03:14:45 pm »
Well, the point is I'm getting the same error when I try to run Steel :
Code: [Select]
[ ceylo ceylo-pc ~/Downloads/Steel src ] ruby Steel.rb
/opt/local/lib/ruby1.9/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- sfml/graphics (LoadError)
from /opt/local/lib/ruby1.9/1.9.1/rubygems/custom_require.rb:36:in `require'
from Steel.rb:1:in `<main>'

That's why I'd like to understand why it's failing.

Thanks,
Ceylo
Want to play movies in your SFML application? Check out sfeMovie!

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Re: rbSFML
« Reply #237 on: April 24, 2012, 04:03:11 pm »
That's tricky.. as far as I can see the library is installed to the correct folder. Try adding this to the top of the main ruby file in Steel:

$: << "/opt/local/lib/ruby1.9/site_ruby/1.9.1/x86_64-darwin11"
« Last Edit: April 24, 2012, 04:04:59 pm by Groogy »
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Re: rbSFML
« Reply #238 on: April 24, 2012, 04:14:52 pm »
It didn't change anything.
Want to play movies in your SFML application? Check out sfeMovie!

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Re: rbSFML
« Reply #239 on: April 24, 2012, 04:46:46 pm »
Hmm maybe there is a missing flag to the linker to create the shared library so it becomes invalid somehow? Do the compilation again with rake verbose and give it to me. Also say if you see some weird value in the CXX and LINK values since I don't know what's right in Clang.

If this fails just swap to GCC by giving these values to these variables:

CXX = "g++"
CXXFLAGS = "-O3 -g -I#{SFML_INC} -I#{EXT_DIR} -I#{RUBY_INC} -I#{RUBY_INC}/#{CONFIG['arch']}"

LINK = "g++ -shared"
LINK_FLAGS = "-Wl,--enable-auto-image-base,--enable-auto-import -L. -L#{SFML_LIB} -L#{RUBY_LIB} #{RUBY_LINK}"

Edit: Actually just tried including a file that doesn't exist. That is the exact message you get. So somehow Steel is not able to read from that path. So installation was correct now I don't know really since this feels like Mac-space. Not 100% sure.
« Last Edit: April 24, 2012, 04:48:51 pm by Groogy »
Developer and Maker of rbSFML and Programmer at Paradox Development Studio