Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Topic Gosu / Gosu Exchange / Problem Installing Gosu on Raspberry Pi
- - By mikedstark Date 2016-09-10 07:18
I can't get Gosu to install on my Pi. I have the pi 3 and have followed the instructions on the wiki and still no luck. https://github.com/gosu/gosu/wiki/Getting-Started-on-Raspbian-%28Raspberry-Pi%29

I had problems getting SDL_ttf to install on Raspbian but was able to on Ubuntu Mate then I tried to

sudo gem install gosu -- --with-cflags=-I/opt/SDL2/include --with-cppflags=-I/opt/SDL2/include --with-ldflags=\"/opt/SDL2/lib/libSDL2.a /opt/SDL2/lib/libSDL2_ttf.a\"

and I get the following error:

Building native extensions with: '--with-cflags=-I/opt/SDL2/include --with-cppflags=-I/opt/SDL2/include --with-ldflags="/opt/SDL2/lib/libSDL2.a /opt/SDL2/lib/libSDL2_ttf.a"'
This could take a while...
ERROR:  Error installing gosu:
  ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/2.3.0/gems/gosu-0.10.8/ext/gosu
/usr/bin/ruby2.3 -r ./siteconf20160910-3133-1edcscw.rb extconf.rb --with-cflags=-I/opt/SDL2/include --with-cppflags=-I/opt/SDL2/include --with-ldflags="/opt/SDL2/lib/libSDL2.a /opt/SDL2/lib/libSDL2_ttf.a"
The Gosu gem requires some libraries to be installed system-wide.
See the following site for a list:
https://github.com/gosu/gosu/wiki/Getting-Started-on-Linux
checking for TTF_RenderUTF8_Blended() in -lSDL2_ttf... yes
checking for SDL_ttf.h... yes
checking for main() in -lopenal... yes
checking for AL/al.h... yes
creating Makefile

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /var/lib/gems/2.3.0/extensions/arm-linux/2.3.0/gosu-0.10.8/mkmf.log

current directory: /var/lib/gems/2.3.0/gems/gosu-0.10.8/ext/gosu
make "DESTDIR=" clean

current directory: /var/lib/gems/2.3.0/gems/gosu-0.10.8/ext/gosu
make "DESTDIR="
compiling Audio-Audio.cpp
compiling Bitmap-Bitmap.cpp
compiling Bitmap-BitmapIO.cpp
In file included from Bitmap-BitmapIO.cpp:1:0:
../../src/Bitmap/BitmapIO.cpp: In function ‘Gosu::Reader Gosu::loadFromBMP(Gosu::Bitmap&, Gosu::Reader)’:
../../src/Bitmap/BitmapIO.cpp:163:12: warning: ‘Gosu::Reader Gosu::loadFromPNG(Gosu::Bitmap&, Gosu::Reader)’ is deprecated [-Wdeprecated-declarations]
     return loadFromPNG(bitmap, reader);
            ^
../../src/Bitmap/BitmapIO.cpp:154:14: note: declared here
Gosu::Reader Gosu::loadFromPNG(Bitmap& bitmap, Reader reader)
              ^
../../src/Bitmap/BitmapIO.cpp:163:12: warning: ‘Gosu::Reader Gosu::loadFromPNG(Gosu::Bitmap&, Gosu::Reader)’ is deprecated [-Wdeprecated-declarations]
     return loadFromPNG(bitmap, reader);
            ^
../../src/Bitmap/BitmapIO.cpp:154:14: note: declared here
Gosu::Reader Gosu::loadFromPNG(Bitmap& bitmap, Reader reader)
              ^
../../src/Bitmap/BitmapIO.cpp:163:38: warning: ‘Gosu::Reader Gosu::loadFromPNG(Gosu::Bitmap&, Gosu::Reader)’ is deprecated [-Wdeprecated-declarations]
     return loadFromPNG(bitmap, reader);
                                      ^
../../src/Bitmap/BitmapIO.cpp:154:14: note: declared here
Gosu::Reader Gosu::loadFromPNG(Bitmap& bitmap, Reader reader)
              ^
compiling DirectoriesUnix.cpp
compiling FileUnix.cpp
In file included from FileUnix.cpp:1:0:
../../src/FileUnix.cpp: In member function ‘virtual void Gosu::File::resize(std::size_t)’:
../../src/FileUnix.cpp:76:34: warning: ignoring return value of ‘int ftruncate(int, __off_t)’, declared with attribute warn_unused_result [-Wunused-result]
     ftruncate(pimpl->fd, newSize);
                                  ^
../../src/FileUnix.cpp: In member function ‘virtual void Gosu::File::read(std::size_t, std::size_t, void*) const’:
../../src/FileUnix.cpp:91:42: warning: ignoring return value of ‘ssize_t read(int, void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
     ::read(pimpl->fd, destBuffer, length);
                                          ^
../../src/FileUnix.cpp: In member function ‘virtual void Gosu::File::write(std::size_t, std::size_t, const void*)’:
../../src/FileUnix.cpp:99:45: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
     ::write(pimpl->fd, sourceBuffer, length);
                                             ^
compiling Graphics-BlockAllocator.cpp
compiling Graphics-Color.cpp
compiling Graphics-Graphics.cpp
In file included from ../../src/Graphics/Graphics.cpp:2:0,
                 from Graphics-Graphics.cpp:1:
../../src/Graphics/Common.hpp:20:21: fatal error: GLES/gl.h: No such file or directory
compilation terminated.
Makefile:231: recipe for target 'Graphics-Graphics.o' failed
make: *** [Graphics-Graphics.o] Error 1

make failed, exit code 2

Gem files will remain installed in /var/lib/gems/2.3.0/gems/gosu-0.10.8 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/arm-linux/2.3.0/gosu-0.10.8/gem_make.out
Parent - - By jlnr (dev) Date 2016-09-10 08:10 Edited 2017-04-05 19:57
I have no experience with the later Raspberry Pi models, only the original one running Raspbian.

Do you have any idea where the GLES headers might be?

../../src/Graphics/Common.hpp:20:21: fatal error: GLES/gl.h: No such file or directory

Maybe they're in the popular /opt/vc/include directory again? If you can find gl.h and pass the directory in via --with-cflags/--with-cppflags, you should get one step further. Not sure what comes next - probably finding the right library to link against :)
Parent - - By mikedstark Date 2016-09-10 09:03
The gl.h file is in /opt/vc/include/GLES
I've tried including the path but I am not sure I am including it properly.
Parent - - By jlnr (dev) Date 2016-09-10 09:06
Should be:
--with-cppflags="-I/opt/SDL2/include -I/opt/vc/include", without the GLES because the #include already includes that part.

Thinking about it, you shouldn't need --with-cflags= at all since Gosu only uses C++, no C.
Parent - - By mikedstark Date 2016-09-10 09:35
One step closer! Thanks so much for your help! My error is getting smaller. I'm not familiar with extconf.rb.

~$ sudo gem install gosu -- --with-cppflags="-I/opt/SDL2/include -I/opt/vc/include" --with-ldflags=\"/opt/SDL2/lib/libSDL2.a /opt/SDL2/lib/libSDL2_ttf.a\"
Building native extensions with: '--with-cppflags=-I/opt/SDL2/include -I/opt/vc/include --with-ldflags="/opt/SDL2/lib/libSDL2.a /opt/SDL2/lib/libSDL2_ttf.a"'
This could take a while...
ERROR:  Error installing gosu:
  ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/2.3.0/gems/gosu-0.10.8/ext/gosu
/usr/bin/ruby2.3 -r ./siteconf20160910-4108-16luooy.rb extconf.rb --with-cppflags=-I/opt/SDL2/include -I/opt/vc/include --with-ldflags="/opt/SDL2/lib/libSDL2.a /opt/SDL2/lib/libSDL2_ttf.a"
The Gosu gem requires some libraries to be installed system-wide.
See the following site for a list:
https://github.com/gosu/gosu/wiki/Getting-Started-on-Linux
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
  --with-opt-dir
  --without-opt-dir
  --with-opt-include
  --without-opt-include=${opt-dir}/include
  --with-opt-lib
  --without-opt-lib=${opt-dir}/lib
  --with-make-prog
  --without-make-prog
  --srcdir=.
  --curdir
  --ruby=/usr/bin/$(RUBY_BASE_NAME)2.3
  --with-gl-config
  --without-gl-config
  --with-pkg-config
  --without-pkg-config
/usr/lib/ruby/2.3.0/mkmf.rb:456:in try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
  from /usr/lib/ruby/2.3.0/mkmf.rb:541:in
try_link0'
  from /usr/lib/ruby/2.3.0/mkmf.rb:556:in try_link'
  from /usr/lib/ruby/2.3.0/mkmf.rb:657:in
try_ldflags'
  from /usr/lib/ruby/2.3.0/mkmf.rb:1813:in pkg_config'
  from extconf.rb:105:in
<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /var/lib/gems/2.3.0/extensions/arm-linux/2.3.0/gosu-0.10.8/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.3.0/gems/gosu-0.10.8 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/arm-linux/2.3.0/gosu-0.10.8/gem_make.out
Parent - - By jlnr (dev) Date 2016-09-10 18:18
I forgot to escape the quotes, can you please try this instead:

sudo gem install gosu -- --with-cppflags=\"-I/opt/SDL2/include -I/opt/vc/include\" --with-ldflags=\"/opt/SDL2/lib/libSDL2.a /opt/SDL2/lib/libSDL2_ttf.a\"

If it still doesn't work - what's the output in the mkmf.log / gem_make.out file that are mentioned in the error?
Parent - - By mikedstark Date 2016-09-10 20:12
I had an ‘-fstack-protector-strong’ error which I believe is from having gcc 4.7.
I switched to gcc 4.9 and that did away with the fstack error but now have the following. I will try and work on this more later tonight.

log file now gives me this:
cat /var/lib/gems/2.3.0/extensions/arm-linux/2.3.0/gosu-0.10.8/mkmf.log

[tt| pkg-config --libs gl
=> "-lGL\n"
"gcc -o conftest -I/usr/include/arm-linux-gnueabihf/ruby-2.3.0 -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -I../.. -I../../src -I/opt/SDL2/include -I/opt/vc/include -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DGOSU_DEPRECATED= conftest.c  -L. -L/usr/lib/arm-linux-gnueabihf /opt/SDL2/lib/libSDL2.a /opt/SDL2/lib/libSDL2_ttf.a     -lruby-2.3  -lpthread -lgmp -ldl -lcrypt -lm   -lc"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

"gcc -o conftest -I/usr/include/arm-linux-gnueabihf/ruby-2.3.0 -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -I../.. -I../../src -I/opt/SDL2/include -I/opt/vc/include -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DGOSU_DEPRECATED= conftest.c  -L. -L/usr/lib/arm-linux-gnueabihf /opt/SDL2/lib/libSDL2.a /opt/SDL2/lib/libSDL2_ttf.a     -lruby-2.3 -lGL -lpthread -lgmp -ldl -lcrypt -lm   -lc"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

| pkg-config --cflags-only-I gl
=> "-I/usr/include/libdrm\n"
| pkg-config --cflags-only-other gl
=> "\n"
| pkg-config --libs-only-l gl
=> "-lGL\n"
package configuration for gl
cflags:
ldflags:
libs: -lGL

| pkg-config --libs sdl2
=> "-lSDL2\n"
"gcc -o conftest -I/usr/include/arm-linux-gnueabihf/ruby-2.3.0 -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -I../.. -I../../src -I/usr/include/libdrm -I/opt/SDL2/include -I/opt/vc/include -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DGOSU_DEPRECATED=  conftest.c  -L. -L/usr/lib/arm-linux-gnueabihf /opt/SDL2/lib/libSDL2.a /opt/SDL2/lib/libSDL2_ttf.a      -lGL -lruby-2.3 -lSDL2 -lpthread -lgmp -ldl -lcrypt -lm   -lc"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

| pkg-config --cflags-only-I sdl2
=> "-I/usr/include/SDL2\n"
| pkg-config --cflags-only-other sdl2
=> "-D_REENTRANT\n"
| pkg-config --libs-only-l sdl2
=> "-lSDL2\n"
package configuration for sdl2
cflags: -D_REENTRANT
ldflags:
libs: -lSDL2

| pkg-config --libs pangoft2
=> "-lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype\n"
"gcc -o conftest -I/usr/include/arm-linux-gnueabihf/ruby-2.3.0 -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -I../.. -I../../src -I/usr/include/libdrm -I/usr/include/SDL2 -I/opt/SDL2/include -I/opt/vc/include -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DGOSU_DEPRECATED=  -D_REENTRANT conftest.c  -L. -L/usr/lib/arm-linux-gnueabihf /opt/SDL2/lib/libSDL2.a /opt/SDL2/lib/libSDL2_ttf.a       -lGL -lSDL2 -lruby-2.3 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype -lpthread -lgmp -ldl -lcrypt -lm   -lc"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

| pkg-config --cflags-only-I pangoft2
=> "-I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include -I/usr/include/freetype2\n"
| pkg-config --cflags-only-other pangoft2
=> "\n"
| pkg-config --libs-only-l pangoft2
=> "-lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype\n"
package configuration for pangoft2
cflags:
ldflags:
libs: -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype

| pkg-config --libs vorbisfile
=> "-lvorbisfile\n"
"gcc -o conftest -I/usr/include/arm-linux-gnueabihf/ruby-2.3.0 -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -I../.. -I../../src -I/usr/include/libdrm -I/usr/include/SDL2 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include -I/usr/include/freetype2 -I/opt/SDL2/include -I/opt/vc/include -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DGOSU_DEPRECATED=  -D_REENTRANT  conftest.c  -L. -L/usr/lib/arm-linux-gnueabihf /opt/SDL2/lib/libSDL2.a /opt/SDL2/lib/libSDL2_ttf.a        -lGL -lSDL2 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype -lruby-2.3 -lvorbisfile -lpthread -lgmp -ldl -lcrypt -lm   -lc"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

| pkg-config --cflags-only-I vorbisfile
=> "\n"
| pkg-config --cflags-only-other vorbisfile
=> "\n"
| pkg-config --libs-only-l vorbisfile
=> "-lvorbisfile\n"
package configuration for vorbisfile
cflags:
ldflags:
libs: -lvorbisfile

| pkg-config --libs openal
=> "-lopenal\n"
"gcc -o conftest -I/usr/include/arm-linux-gnueabihf/ruby-2.3.0 -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -I../.. -I../../src -I/usr/include/libdrm -I/usr/include/SDL2 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include -I/usr/include/freetype2  -I/opt/SDL2/include -I/opt/vc/include -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DGOSU_DEPRECATED=  -D_REENTRANT   conftest.c  -L. -L/usr/lib/arm-linux-gnueabihf /opt/SDL2/lib/libSDL2.a /opt/SDL2/lib/libSDL2_ttf.a         -lGL -lSDL2 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype -lvorbisfile -lruby-2.3 -lopenal -lpthread -lgmp -ldl -lcrypt -lm   -lc"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

| pkg-config --cflags-only-I openal
=> "-I/usr/include/AL\n"
| pkg-config --cflags-only-other openal
=> "\n"
| pkg-config --libs-only-l openal
=> "-lopenal\n"
package configuration for openal
cflags:
ldflags:
libs: -lopenal

| pkg-config --libs sndfile
=> "-lsndfile\n"
"gcc -o conftest -I/usr/include/arm-linux-gnueabihf/ruby-2.3.0 -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -I../.. -I../../src -I/usr/include/libdrm -I/usr/include/SDL2 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include -I/usr/include/freetype2  -I/usr/include/AL -I/opt/SDL2/include -I/opt/vc/include -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DGOSU_DEPRECATED=  -D_REENTRANT    conftest.c  -L. -L/usr/lib/arm-linux-gnueabihf /opt/SDL2/lib/libSDL2.a /opt/SDL2/lib/libSDL2_ttf.a          -lGL -lSDL2 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype -lvorbisfile -lopenal -lruby-2.3 -lsndfile -lpthread -lgmp -ldl -lcrypt -lm   -lc"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

| pkg-config --cflags-only-I sndfile
=> "\n"
| pkg-config --cflags-only-other sndfile
=> "\n"
| pkg-config --libs-only-l sndfile
=> "-lsndfile\n"
package configuration for sndfile
cflags:
ldflags:
libs: -lsndfile

have_library: checking for TTF_RenderUTF8_Blended() in -lSDL2_ttf... -------------------- yes

"gcc -o conftest -I/usr/include/arm-linux-gnueabihf/ruby-2.3.0 -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -I../.. -I../../src -I/usr/include/libdrm -I/usr/include/SDL2 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include -I/usr/include/freetype2  -I/usr/include/AL  -I/opt/SDL2/include -I/opt/vc/include -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DGOSU_DEPRECATED=  -D_REENTRANT     conftest.c  -L. -L/usr/lib/arm-linux-gnueabihf /opt/SDL2/lib/libSDL2.a /opt/SDL2/lib/libSDL2_ttf.a           -lGL -lSDL2 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype -lvorbisfile -lopenal -lsndfile -lruby-2.3 -lSDL2_ttf  -lGL -lSDL2 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype -lvorbisfile -lopenal -lsndfile -lpthread -lgmp -ldl -lcrypt -lm   -lc"
conftest.c: In function ‘t’:
conftest.c:13:57: error: ‘TTF_RenderUTF8_Blended’ undeclared (first use in this function)
int t(void) { void ((*volatile p)()); p = (void ((*)()))TTF_RenderUTF8_Blended; return !p; }
                                                         ^
conftest.c:13:57: note: each undeclared identifier is reported only once for each function it appears in
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: /*top*/
4: extern int t(void);
5: int main(int argc, char **argv)
6: {
7:   if (argc > 1000000) {
8:     printf("%p", &t);
9:   }
10:
11:   return 0;
12: }
13: int t(void) { void ((*volatile p)()); p = (void ((*)()))TTF_RenderUTF8_Blended; return !p; }
/* end */

"gcc -o conftest -I/usr/include/arm-linux-gnueabihf/ruby-2.3.0 -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -I../.. -I../../src -I/usr/include/libdrm -I/usr/include/SDL2 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include -I/usr/include/freetype2  -I/usr/include/AL  -I/opt/SDL2/include -I/opt/vc/include -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DGOSU_DEPRECATED=  -D_REENTRANT     conftest.c  -L. -L/usr/lib/arm-linux-gnueabihf /opt/SDL2/lib/libSDL2.a /opt/SDL2/lib/libSDL2_ttf.a           -lGL -lSDL2 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype -lvorbisfile -lopenal -lsndfile -lruby-2.3 -lSDL2_ttf  -lGL -lSDL2 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype -lvorbisfile -lopenal -lsndfile -lpthread -lgmp -ldl -lcrypt -lm   -lc"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: /*top*/
4: extern int t(void);
5: int main(int argc, char **argv)
6: {
7:   if (argc > 1000000) {
8:     printf("%p", &t);
9:   }
10:
11:   return 0;
12: }
13: extern void TTF_RenderUTF8_Blended();
14: int t(void) { TTF_RenderUTF8_Blended(); return 0; }
/* end */

--------------------

have_header: checking for SDL_ttf.h... -------------------- yes

"gcc -E -I/usr/include/arm-linux-gnueabihf/ruby-2.3.0 -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -I../.. -I../../src -I/usr/include/libdrm -I/usr/include/SDL2 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include -I/usr/include/freetype2  -I/usr/include/AL  -I/opt/SDL2/include -I/opt/vc/include -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DGOSU_DEPRECATED=  -D_REENTRANT      conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <SDL_ttf.h>
/* end */

--------------------

have_library: checking for main() in -lopenal... -------------------- yes

"gcc -o conftest -I/usr/include/arm-linux-gnueabihf/ruby-2.3.0 -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -I../.. -I../../src -I/usr/include/libdrm -I/usr/include/SDL2 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include -I/usr/include/freetype2  -I/usr/include/AL  -I/opt/SDL2/include -I/opt/vc/include -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DGOSU_DEPRECATED=  -D_REENTRANT     conftest.c  -L. -L/usr/lib/arm-linux-gnueabihf /opt/SDL2/lib/libSDL2.a /opt/SDL2/lib/libSDL2_ttf.a          -lSDL2_ttf  -lGL -lSDL2 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype -lvorbisfile -lopenal -lsndfile -lruby-2.3 -lopenal -lSDL2_ttf  -lGL -lSDL2 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype -lvorbisfile -lopenal -lsndfile -lpthread -lgmp -ldl -lcrypt -lm   -lc"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: /*top*/
4: extern int t(void);
5: int main(int argc, char **argv)
6: {
7:   if (argc > 1000000) {
8:     printf("%p", &t);
9:   }
10:
11:   return 0;
12: }
13: int t(void) { void ((*volatile p)()); p = (void ((*)()))main; return !p; }
/* end */

--------------------

have_header: checking for AL/al.h... -------------------- yes

"gcc -E -I/usr/include/arm-linux-gnueabihf/ruby-2.3.0 -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -I../.. -I../../src -I/usr/include/libdrm -I/usr/include/SDL2 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include -I/usr/include/freetype2  -I/usr/include/AL  -I/opt/SDL2/include -I/opt/vc/include -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DGOSU_DEPRECATED=  -D_REENTRANT      conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <AL/al.h>
/* end */

--------------------
]
Parent - - By mikedstark Date 2016-09-10 20:22
cat of /gem_make.out

current directory: /var/lib/gems/2.3.0/gems/gosu-0.10.8/ext/gosu
/usr/bin/ruby2.3 -r ./siteconf20160910-17079-lqn9gi.rb extconf.rb --with-cppflags="-I/opt/SDL2/include -I/opt/vc/include" --with-ldflags="/opt/SDL2/lib/libSDL2.a /opt/SDL2/lib/libSDL2_ttf.a"
The Gosu gem requires some libraries to be installed system-wide.
See the following site for a list:
https://github.com/gosu/gosu/wiki/Getting-Started-on-Linux
checking for TTF_RenderUTF8_Blended() in -lSDL2_ttf... yes
checking for SDL_ttf.h... yes
checking for main() in -lopenal... yes
checking for AL/al.h... yes
creating Makefile

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /var/lib/gems/2.3.0/extensions/arm-linux/2.3.0/gosu-0.10.8/mkmf.log

current directory: /var/lib/gems/2.3.0/gems/gosu-0.10.8/ext/gosu
make "DESTDIR=" clean

current directory: /var/lib/gems/2.3.0/gems/gosu-0.10.8/ext/gosu
make "DESTDIR="
compiling Audio-Audio.cpp
compiling Bitmap-Bitmap.cpp
compiling Bitmap-BitmapIO.cpp
In file included from Bitmap-BitmapIO.cpp:1:0:
../../src/Bitmap/BitmapIO.cpp: In function ‘Gosu::Reader Gosu::loadFromBMP(Gosu::Bitmap&, Gosu::Reader)’:
../../src/Bitmap/BitmapIO.cpp:163:12: warning: ‘Gosu::Reader Gosu::loadFromPNG(Gosu::Bitmap&, Gosu::Reader)’ is deprecated (declared at ../../src/Bitmap/BitmapIO.cpp:154) [-Wdeprecated-declarations]
     return loadFromPNG(bitmap, reader);
            ^
../../src/Bitmap/BitmapIO.cpp:163:38: warning: ‘Gosu::Reader Gosu::loadFromPNG(Gosu::Bitmap&, Gosu::Reader)’ is deprecated (declared at ../../src/Bitmap/BitmapIO.cpp:154) [-Wdeprecated-declarations]
     return loadFromPNG(bitmap, reader);
                                      ^
compiling DirectoriesUnix.cpp
compiling FileUnix.cpp
In file included from FileUnix.cpp:1:0:
../../src/FileUnix.cpp: In member function ‘virtual void Gosu::File::resize(std::size_t)’:
../../src/FileUnix.cpp:76:34: warning: ignoring return value of ‘int ftruncate(int, __off_t)’, declared with attribute warn_unused_result [-Wunused-result]
     ftruncate(pimpl->fd, newSize);
                                  ^
../../src/FileUnix.cpp: In member function ‘virtual void Gosu::File::read(std::size_t, std::size_t, void*) const’:
../../src/FileUnix.cpp:91:42: warning: ignoring return value of ‘ssize_t read(int, void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
     ::read(pimpl->fd, destBuffer, length);
                                          ^
../../src/FileUnix.cpp: In member function ‘virtual void Gosu::File::write(std::size_t, std::size_t, const void*)’:
../../src/FileUnix.cpp:99:45: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
     ::write(pimpl->fd, sourceBuffer, length);
                                             ^
compiling Graphics-BlockAllocator.cpp
compiling Graphics-Color.cpp
compiling Graphics-Graphics.cpp
compiling Graphics-Image.cpp
compiling Graphics-LargeImageData.cpp
compiling Graphics-Macro.cpp
compiling Graphics-Resolution.cpp
compiling Graphics-TexChunk.cpp
compiling Graphics-Texture.cpp
compiling Graphics-Transform.cpp
compiling IO.cpp
compiling Input-Input.cpp
In file included from Input-Input.cpp:1:0:
../../src/Input/Input.cpp: In member function ‘bool Gosu::Input::feedSDLEvent(void*)’:
../../src/Input/Input.cpp:307:65: warning: comparison between ‘const enum SDL_Scancode’ and ‘enum Gosu::ButtonName’ [-Wenum-compare]
             if (e->key.repeat == 0 && e->key.keysym.scancode <= kbRangeEnd) {
                                                                 ^
compiling Input-TextInput.cpp
compiling Inspection.cpp
compiling Math.cpp
compiling Text-Font.cpp
compiling Text-Text.cpp
compiling Text-TextUnix.cpp
In file included from Text-TextUnix.cpp:1:0:
../../src/Text/TextUnix.cpp: In member function ‘unsigned int Gosu::PangoRenderer::textWidth(const wstring&, const wstring&, unsigned int, unsigned int)’:
../../src/Text/TextUnix.cpp:57:13: warning: ‘void g_type_init()’ is deprecated (declared at /usr/include/glib-2.0/gobject/gtype.h:681) [-Wdeprecated-declarations]
             g_type_init();
             ^
../../src/Text/TextUnix.cpp:57:25: warning: ‘void g_type_init()’ is deprecated (declared at /usr/include/glib-2.0/gobject/gtype.h:681) [-Wdeprecated-declarations]
             g_type_init();
                         ^
../../src/Text/TextUnix.cpp:61:23: warning: ‘PangoContext* pango_ft2_get_context(double, double)’ is deprecated (declared at /usr/include/pango-1.0/pango/pangoft2.h:111): Use 'pango_font_map_create_context' instead [-Wdeprecated-declarations]
             context = pango_ft2_get_context(dpi_x, dpi_y);
                       ^
../../src/Text/TextUnix.cpp:61:57: warning: ‘PangoContext* pango_ft2_get_context(double, double)’ is deprecated (declared at /usr/include/pango-1.0/pango/pangoft2.h:111): Use 'pango_font_map_create_context' instead [-Wdeprecated-declarations]
             context = pango_ft2_get_context(dpi_x, dpi_y);
                                                         ^
compiling TimingUnix.cpp
compiling Utility.cpp
compiling Window.cpp
compiling gosu_wrap.cxx
gosu_wrap.cxx: In function ‘VALUE _wrap_Font_draw_rot(int, VALUE*, VALUE)’:
gosu_wrap.cxx:5483:111: warning: ‘void Gosu::Font::drawRot(const wstring&, double, double, Gosu::ZPos, double, double, double, Gosu::Color, Gosu::AlphaMode) const’ is deprecated (declared at ../../Gosu/Font.hpp:81) [-Wdeprecated-declarations]
       ((Gosu::Font const *)arg1)->drawRot((std::wstring const &)*arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);
                                                                                                               ^
compiling stb_vorbis.c
linking shared-object gosu.so
/usr/bin/ld: /opt/SDL2/lib/libSDL2.a(SDL_dynapi.o): relocation R_ARM_THM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/opt/SDL2/lib/libSDL2.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:255: recipe for target 'gosu.so' failed
make: *** [gosu.so] Error 1

make failed, exit code 2
Parent - - By jlnr (dev) Date 2016-09-11 08:07
Ouch, this line is the actual error:

/usr/bin/ld: /opt/SDL2/lib/libSDL2.a(SDL_dynapi.o): relocation R_ARM_THM_MOVW_ABS_NC against 'a local symbol' can not be used when making a shared object; recompile with -fPIC

Do you have a /opt/SDL2/lib/libSDL2.so file as well? Can you please try passing that in, instead of the static .a library?
Parent - - By mikedstark Date 2016-09-11 12:55
New problem but first, Thanks for your help! To summarize, with your help I got gosu (0.10.8) to install by following the wiki, changing to gcc 4.9 from 4.7, and this last line:


$ sudo gem install gosu -- --with-cppflags=\"-I/opt/SDL2/include -I/opt/vc/include\" --with-ldflags=\"/opt/SDL2/lib/libSDL2.so /opt/SDL2/lib/libSDL2_ttf.so\"


I changed both libSDL2.a and libSDL2tff.a to *.so respectfully.

Now the new problem:

When I run a gosu program, the screen is completly black. I have executed the program in both fullscreen and not full with the same results. When not in fullscreen, the canvas does appear with the title. The program runs on my mac just fine. Source linked down below. Thanks again!

https://github.com/mikedstark/ruby-pong
Parent - - By jlnr (dev) Date 2016-09-17 09:48
Hm. :/ The one thing I can still suggest is to re-compile SDL2 without OpenGL, just to be sure it doesn't try to use normal (non-ES) OpenGL. There's a full command-line here for the Pi 2 (which should also apply for the Pi 3): https://solarianprogrammer.com/2015/01/22/raspberry-pi-raspbian-getting-started-sdl-2/

If that doesn't help, I'm out of ideas - no idea how to debug the black screen.
Parent - By mikedstark Date 2016-09-23 07:13
Still no luck. I will post if I can figure out what's wrong. I'm making an arcade that will play games that I will make. I have an old laptop that will be powering the arcade for now. I would like to swap out the laptop with my Pi 3 but that hinges on getting gosu to work on the Pi of course. I think I will try to install an older version of raspbian on the pi to see if that helps.
Parent - By jlnr (dev) Date 2017-04-05 19:59
It turns out that getting Gosu to work on the Pi 2 and 3 is much easier than on the original Pi. Basically, just enable OpenGL and then install Gosu as you would on a normal Linux distro (but be sure to sudo gem install gosu --pre until 0.11.4 is out).

https://github.com/gosu/gosu/wiki/Getting-Started-on-Raspbian-(Raspberry-Pi)

Probably too late, but maybe it'll be helpful for the next person looking into this.
Up Topic Gosu / Gosu Exchange / Problem Installing Gosu on Raspberry Pi

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill