I'm trying to install this Ruby gem on FreeBSD, and it's failing with the following error:
# gem install gosu
Building native extensions. This could take a while...
ERROR: Error installing gosu:
ERROR: Failed to build gem native extension.
current directory: /usr/local/lib/ruby/gems/2.4/gems/gosu-0.14.5/ext/gosu
/usr/local/bin/ruby24 -I /usr/local/lib/ruby/site_ruby/2.4 -r ./siteconf20190322-6847-x8s25j.rb extconf.rb
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
cat: /proc/cpuinfo: No such file or directory
checking for -lopenal... yes
checking for AL/al.h... yes
creating Makefile
current directory: /usr/local/lib/ruby/gems/2.4/gems/gosu-0.14.5/ext/gosu
make "DESTDIR=" clean
current directory: /usr/local/lib/ruby/gems/2.4/gems/gosu-0.14.5/ext/gosu
make "DESTDIR="
compiling ../../src/Audio.cpp
In file included from ../../src/Audio.cpp:17:
../../src/SndFile.hpp:111:33: warning: field 'buffer' is uninitialized when used here [-Wuninitialized]
: file(nullptr), reader(buffer.front_reader())
^
../../src/SndFile.hpp:123:33: warning: field 'buffer' is uninitialized when used here [-Wuninitialized]
: file(nullptr), reader(buffer.front_reader())
^
2 warnings generated.
compiling ../../src/AudioImpl.cpp
compiling ../../src/Bitmap.cpp
compiling ../../src/BitmapIO.cpp
compiling ../../src/BlockAllocator.cpp
compiling ../../src/Channel.cpp
compiling ../../src/Color.cpp
compiling ../../src/DirectoriesApple.cpp
compiling ../../src/DirectoriesUnix.cpp
compiling ../../src/DirectoriesWin.cpp
compiling ../../src/FileUnix.cpp
../../src/FileUnix.cpp:53:47: error: use of undeclared identifier 'S_IRUSR'
pimpl->fd = open(filename.c_str(), flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
^
../../src/FileUnix.cpp:53:55: error: use of undeclared identifier 'S_IWUSR'
pimpl->fd = open(filename.c_str(), flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
^
../../src/FileUnix.cpp:53:63: error: use of undeclared identifier 'S_IRGRP'
pimpl->fd = open(filename.c_str(), flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
^
../../src/FileUnix.cpp:53:71: error: use of undeclared identifier 'S_IWGRP'
pimpl->fd = open(filename.c_str(), flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
^
../../src/FileUnix.cpp:53:79: error: use of undeclared identifier 'S_IROTH'
pimpl->fd = open(filename.c_str(), flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
^
../../src/FileUnix.cpp:53:87: error: use of undeclared identifier 'S_IWOTH'
pimpl->fd = open(filename.c_str(), flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
^
6 errors generated.
*** Error code 1
Stop.
make: stopped in /usr/local/lib/ruby/gems/2.4/gems/gosu-0.14.5/ext/gosu
Other things I tried:
Switching compilers - from clang and c++ to g++ and gcc.
Cloning the repository and building "manually" - got the same errors.
Is it even possible to install it on FreeBSD? Searches didn't return anything useful.
On FreeBSD system headers are organized slightly differently than in Linux.
Quick man lookup reveals, that you need to
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
to make these definitions visible.
Related
I'm trying to gem install t(a command line tool for Twitter) in my OSX High Sierra. My Ruby version is ruby 2.3.7p456.
But I am getting the error below:
~> gem install t
Building native extensions. This could take a while...
ERROR: Error installing t:
ERROR: Failed to build gem native extension.
/Users/akira/.rbenv/versions/2.2.1/bin/ruby -r ./siteconf20181213-96401-3tpab1.rb extconf.rb
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling ryah_http_parser.c
In file included from ryah_http_parser.c:24:
In file included from ./ryah_http_parser.h:44:
In file included from /usr/local/include/stdint.h:59:
In file included from /usr/local/include/stdint.h:59:
....
/usr/local/include/stdint.h:2:10: error: #include nested too deeply
#include <stddef.h>
^
/usr/local/include/stdint.h:59:11: error: #include nested too deeply
# include <stdint.h>
^
/usr/local/include/stdint.h:72:11: error: #include nested too deeply
# include <sys/types.h>
^
In file included from ryah_http_parser.c:24:
./ryah_http_parser.h:210:3: error: unknown type name 'uint64_t'
uint64_t content_length; /* # bytes in body (0 if no Content-Length header) */
^
In file included from ryah_http_parser.c:28:
In file included from /usr/include/stdlib.h:65:
In file included from /usr/include/sys/wait.h:110:
/usr/include/sys/resource.h:197:2: error: unknown type name 'uint64_t'
uint64_t ri_user_time;
^
/usr/include/sys/resource.h:198:2: error: unknown type name 'uint64_t'
uint64_t ri_system_time;
^
/usr/include/sys/resource.h:199:2: error: unknown type name 'uint64_t'
uint64_t ri_pkg_idle_wkups;
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [ryah_http_parser.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/akira/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/http_parser.rb-0.6.0 for inspection.
Results logged to /Users/akira/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-15/2.2.0-static/http_parser.rb-0.6.0/gem_make.out
Does anyone have any idea what the problem is here?
Looks like you need to install the command line dev tools on osx.
Run xcode-select --install and try again.
Installed g++ 4.9.0 (experimental) version under Ubuntu (I am using certain features provided by this version)
When building my code, I use cmake from a script, and it builds correctly. gcc below contains the path where g++ is installed (/mnt...)
$_cmake_ $_dir_ -DCMAKE_CXX_COMPILER=${_gpp_} -DCMAKE_C_COMPILER=${_gcc_} -DCMAKE_BUILD_TYPE=${_build_} -DCMAKE_INSTALL_PREFIX=${_install_} -DBUILD_TESTING:BOOL=1
Now, when I make the CppuTest to build the Unit Tests for my code, I get the following error.
make all
compiling UncrosserTest.cpp
In file included from /home/miguel/Desktop/Ugur/scmProject/scm/dist/dev/mfx_prod/scm/20160207/include/scm/services/primitives.hpp:4:0,
from /home/miguel/Desktop/Ugur/scmProject/log/lidya/src/cpp/scm/services/examples/dummy_strategy/Inside.hpp:6,
from AllTests/Uncrosser/UncrosserTest.cpp:7:
/usr/include/c++/4.9/experimental/optional: In member function ‘void std::experimental::_Optional_base<_Tp, _ShouldProvideDestructor>::_M_construct(_Args&& ...)’:
/usr/include/c++/4.9/experimental/optional:294:18: error: expected type-specifier
::new (std::__addressof(this->_M_payload))
^
/usr/include/c++/4.9/experimental/optional:294:18: error: expected ‘)’
/usr/include/c++/4.9/experimental/optional: In member function ‘void std::experimental::_Optional_base<_Tp, false>::_M_construct(_Args&& ...)’:
/usr/include/c++/4.9/experimental/optional:424:18: error: expected type-specifier
::new (std::__addressof(this->_M_payload))
^
/usr/include/c++/4.9/experimental/optional:424:18: error: expected ‘)’
make: *** [objs/AllTests/Uncrosser/UncrosserTest.o] Error 1
In the CppuTest makefile have included CPPUTEST_CPPFLAGS += -std=c++1y. I guess that am missing some flags in this makefile because as I said the C++ experimental library is building correctly in my "regular" code. What am I missing ?
Possible it's an include problem, see CppUTest Manual - section Conflicts with operator new macros (STL!) and Conflicts with my own overload!
TL;DR
In UncrosserTest add includes for CppUTest after your's.
Instead of
#include <CppUTest/TestHarnes.h>
#include "whatever.h"
do
#include "whatever.h"
#include <CppUTest/TestHarnes.h>
I'm trying to understand how to fix error:
C:\inetpub\wwwroot\DISCOU~2>gem install fast_stack
ERROR: Error installing fast_stack:
ERROR: Failed to build gem native extension.
C:/Ruby200/bin/ruby.exe extconf.rb
creating Makefile
make "DESTDIR="
generating fast_stack-i386-mingw32.def
compiling fast_stack.c
In file included from c:/Ruby200/include/ruby-2.0.0/ruby/defines.h:153:0,
from c:/Ruby200/include/ruby-2.0.0/ruby/ruby.h:70,
from c:/Ruby200/include/ruby-2.0.0/ruby.h:33,
from fast_stack.c:3:
c:/Ruby200/include/ruby-2.0.0/ruby/win32.h:276:12: error: conflicting types for 'gettimeofday'
In file included from fast_stack.c:2:0:
c:\ruby200\devkit\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/include/sys/time.h:42:13: note: previous declaration of 'gettimeofday' was here
fast_stack.c: In function 'rb_profile_start':
fast_stack.c:9:22: error: storage size of 'timer' isn't known
fast_stack.c:11:34: error: 'suseconds_t' undeclared (first use in this function)
fast_stack.c:11:34: note: each undeclared identifier is reported only once for each function it appears in
fast_stack.c:11:46: error: expected ';' before 'rb_num2long_inline'
fast_stack.c:13:5: warning: implicit declaration of function 'setitimer' [-Wimplicit-function-declaration]
fast_stack.c:13:15: error: 'ITIMER_REAL' undeclared (first use in this function)
fast_stack.c:9:22: warning: unused variable 'timer' [-Wunused-variable]
fast_stack.c: In function 'rb_profile_stop':
fast_stack.c:21:22: error: storage size of 'timer' isn't known
fast_stack.c:23:15: error: 'ITIMER_REAL' undeclared (first use in this function)
fast_stack.c:21:22: warning: unused variable 'timer' [-Wunused-variable]
make: *** [fast_stack.o] Error 1
Gem files will remain installed in C:/inetpub/wwwroot/DISCOU~2/GEM_HOME/gems/fast_stack-0.1.0 for inspection.
It happens when I write "bundle install" command for the discourse.org application installing on Helicon Zoo environment.
It appears that it's not the Zoo itself, more issue with the gem. Try to install it separately, outside the environment of Zoo. Simply Ruby, in test catalog, but outside the Zoo. If that's working, contact HeliconTech directly and address as an issue, they're quite quick and good at fixing these things.
This question already has answers here:
Ruby Gem install Json fails on Mavericks and Xcode 5.1 - unknown argument: '-multiply_definedsuppress'
(11 answers)
Closed 8 years ago.
I am attempting to install a gem, and I get this error, which myself and the gem author have never seen before. How do I fix this?
Davids-MacBook-Pro:web david$ sudo /usr/bin/gem install compass --pre
Password:
Building native extensions. This could take a while...
ERROR: Error installing compass:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
checking for ffi.h... no
checking for ffi.h in /usr/local/include,/usr/include/ffi... yes
checking for ffi_call() in -lffi... yes
checking for ffi_prep_closure()... yes
checking for ffi_raw_call()... no
checking for rb_thread_blocking_region()... yes
checking for rb_thread_call_with_gvl()... yes
checking for rb_thread_call_without_gvl()... yes
checking for ffi_prep_cif_var()... no
creating extconf.h
creating Makefile
make "DESTDIR="
compiling AbstractMemory.c
compiling ArrayType.c
compiling Buffer.c
compiling Call.c
Call.c:303:5: warning: implicit declaration of function 'rb_thread_call_without_gvl' is invalid in C99 [-Wimplicit-function-declaration]
rbffi_thread_blocking_region(call_blocking_function, data, (void *) -1, NULL);
^
./Thread.h:78:39: note: expanded from macro 'rbffi_thread_blocking_region'
# define rbffi_thread_blocking_region rb_thread_call_without_gvl
^
1 warning generated.
compiling ClosurePool.c
compiling DataConverter.c
DataConverter.c:43:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
1 warning generated.
compiling DynamicLibrary.c
compiling ffi.c
compiling Function.c
Function.c:479:33: warning: incompatible pointer types passing 'VALUE (void *)' to parameter of type 'void *(*)(void *)' [-Wincompatible-pointer-types]
rb_thread_call_with_gvl(callback_with_gvl, &cb);
^~~~~~~~~~~~~~~~~
Function.c:102:46: note: passing argument to parameter 'func' here
extern void *rb_thread_call_with_gvl(void *(*func)(void *), void *data1);
^
Function.c:563:9: warning: implicit declaration of function 'rb_thread_call_without_gvl' is invalid in C99 [-Wimplicit-function-declaration]
rb_thread_call_without_gvl(async_cb_wait, &w, async_cb_stop, &w);
^
Function.c:738:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
3 warnings generated.
compiling FunctionInfo.c
compiling LastError.c
compiling LongDouble.c
compiling MappedType.c
compiling MemoryPointer.c
compiling MethodHandle.c
compiling Platform.c
compiling Pointer.c
compiling Struct.c
compiling StructByReference.c
compiling StructByValue.c
compiling StructLayout.c
compiling Thread.c
compiling Type.c
compiling Types.c
compiling Variadic.c
linking shared-object ffi_c.bundle
clang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
make: *** [ffi_c.bundle] Error 1
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/ffi-1.9.3 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/gems/ffi-1.9.3/ext/ffi_c/gem_make.out
If this is occuring in OSX Mavericks, please ensure the command line tools are installed by running the following.
Older editions of OSX & XCode had the install for Command Line Tools in the XCode IDE itself. In OSX Mavericks I had to run the commands below to fix my command line tools so that I could install rubygems using native extensions.
$ sudo xcode-select --install
$ xcode-select --print-path
/Library/Developer/CommandLineTools
Try this:
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install <gemName>
For an explanation see this answer
On OSX-10.9.5 using xcode-select --install did not work for me. It started and asked to confirm the licence but then reported that it could not find the software.
I ended up visiting: https://developer.apple.com/downloads/index.action#, downloading the appropriate CommandLineTools dmg for OSX-10.9.5, installing the tools manually from the pkg, and then using: xcode-select --switch=/Library/Developer/CommandLineTools, to set the path.
After which everything worked fine.
This is an Apple LLVM error.
For now, you can:
export ARCHFLAGS="-Wno-error=unused-command-line-argument-hard-error-in-future"
Though as you can see from the warning name this not a permanent solution.
Source: https://langui.sh/2014/03/10/wunused-command-line-argument-hard-error-in-future-is-a-harsh-mistress/
I'm doing some tutorials on OpenGL that use FreeGLUT.
Apparently this is how you build and install it on the mac:
CPPFLAGS="-I/usr/X11R6/include" ./configure --prefix="${PWD}/../"
make
make install
Unfortunately this on its own gives me an error when I do the make command: Undefined symbols for architecture x86_64
After doing abit of work I've found that an improvement on the first line is:
CPPFLAGS="-I/usr/X11R6/include -L/usr/X11R6/lib" LDFLAGS="-L/usr/X11R6/lib" ./configure --prefix="${PWD}/../"
Unfortunately when I do the make command I'm still getting an error:
gcc -DHAVE_CONFIG_H -I. -I../../.. -I/usr/X11R6/include -L/usr/X11R6/lib -I../../../include -g -O2 -Wall -pedantic -MT smooth_opengl3-smooth_opengl3.o -MD -MP -MF .deps/smooth_opengl3-smooth_opengl3.Tpo -c -o smooth_opengl3-smooth_opengl3.o `test -f 'smooth_opengl3.c' || echo './'`smooth_opengl3.c
smooth_opengl3.c:101: error: redefinition of typedef ‘PFNGLGENBUFFERSPROC’
/usr/X11R6/include/GL/glext.h:5080: error: previous declaration of ‘PFNGLGENBUFFERSPROC’ was here
smooth_opengl3.c:102: error: redefinition of typedef ‘PFNGLBINDBUFFERPROC’
/usr/X11R6/include/GL/glext.h:5078: error: previous declaration of ‘PFNGLBINDBUFFERPROC’ was here
smooth_opengl3.c:103: error: redefinition of typedef ‘PFNGLBUFFERDATAPROC’
/usr/X11R6/include/GL/glext.h:5082: error: previous declaration of ‘PFNGLBUFFERDATAPROC’ was here
smooth_opengl3.c:104: error: redefinition of typedef ‘PFNGLCREATESHADERPROC’
/usr/X11R6/include/GL/glext.h:5197: error: previous declaration of ‘PFNGLCREATESHADERPROC’ was here
smooth_opengl3.c:105: error: redefinition of typedef ‘PFNGLSHADERSOURCEPROC’
/usr/X11R6/include/GL/glext.h:5222: error: previous declaration of ‘PFNGLSHADERSOURCEPROC’ was here
smooth_opengl3.c:106: error: redefinition of typedef ‘PFNGLCOMPILESHADERPROC’
/usr/X11R6/include/GL/glext.h:5195: error: previous declaration of ‘PFNGLCOMPILESHADERPROC’ was here
smooth_opengl3.c:107: error: redefinition of typedef ‘PFNGLCREATEPROGRAMPROC’
/usr/X11R6/include/GL/glext.h:5196: error: previous declaration of ‘PFNGLCREATEPROGRAMPROC’ was here
smooth_opengl3.c:108: error: redefinition of typedef ‘PFNGLATTACHSHADERPROC’
/usr/X11R6/include/GL/glext.h:5193: error: previous declaration of ‘PFNGLATTACHSHADERPROC’ was here
smooth_opengl3.c:109: error: redefinition of typedef ‘PFNGLLINKPROGRAMPROC’
/usr/X11R6/include/GL/glext.h:5221: error: previous declaration of ‘PFNGLLINKPROGRAMPROC’ was here
smooth_opengl3.c:110: error: redefinition of typedef ‘PFNGLUSEPROGRAMPROC’
/usr/X11R6/include/GL/glext.h:5223: error: previous declaration of ‘PFNGLUSEPROGRAMPROC’ was here
smooth_opengl3.c:111: error: redefinition of typedef ‘PFNGLGETSHADERIVPROC’
/usr/X11R6/include/GL/glext.h:5209: error: previous declaration of ‘PFNGLGETSHADERIVPROC’ was here
smooth_opengl3.c:112: error: redefinition of typedef ‘PFNGLGETSHADERINFOLOGPROC’
/usr/X11R6/include/GL/glext.h:5210: error: previous declaration of ‘PFNGLGETSHADERINFOLOGPROC’ was here
smooth_opengl3.c:113: error: redefinition of typedef ‘PFNGLGETPROGRAMIVPROC’
/usr/X11R6/include/GL/glext.h:5207: error: previous declaration of ‘PFNGLGETPROGRAMIVPROC’ was here
smooth_opengl3.c:114: error: redefinition of typedef ‘PFNGLGETPROGRAMINFOLOGPROC’
/usr/X11R6/include/GL/glext.h:5208: error: previous declaration of ‘PFNGLGETPROGRAMINFOLOGPROC’ was here
smooth_opengl3.c:115: error: redefinition of typedef ‘PFNGLGETATTRIBLOCATIONPROC’
/usr/X11R6/include/GL/glext.h:5206: error: previous declaration of ‘PFNGLGETATTRIBLOCATIONPROC’ was here
smooth_opengl3.c:116: error: redefinition of typedef ‘PFNGLVERTEXATTRIBPOINTERPROC’
/usr/X11R6/include/GL/glext.h:5280: error: previous declaration of ‘PFNGLVERTEXATTRIBPOINTERPROC’ was here
smooth_opengl3.c:117: error: redefinition of typedef ‘PFNGLENABLEVERTEXATTRIBARRAYPROC’
/usr/X11R6/include/GL/glext.h:5202: error: previous declaration of ‘PFNGLENABLEVERTEXATTRIBARRAYPROC’ was here
smooth_opengl3.c:118: error: redefinition of typedef ‘PFNGLGETUNIFORMLOCATIONPROC’
/usr/X11R6/include/GL/glext.h:5212: error: previous declaration of ‘PFNGLGETUNIFORMLOCATIONPROC’ was here
smooth_opengl3.c:119: error: redefinition of typedef ‘PFNGLUNIFORMMATRIX4FVPROC’
/usr/X11R6/include/GL/glext.h:5242: error: previous declaration of ‘PFNGLUNIFORMMATRIX4FVPROC’ was here
make[4]: *** [smooth_opengl3-smooth_opengl3.o] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
This has been documented on the net before, but the solution isn't really all that helpful in this instance. I've also tried swapping it for the GLUT.framwork that comes with OS X, but the examples are using FreeGLUT-specific functions.
XQuartz 2.7.2 swapped to FreeGLUT (2.8.0) instead of the old MesaGLUT. So provided you have OS X version 10.6.3 or later, you can just install XQuartz 2.7.2 or later. See:
http://xquartz.macosforge.org/trac/wiki/X112.7.2
http://lists.apple.com/archives/x11-users/2012/Apr/msg00020.html
It was suggested on Xquartz's mail list, that the freeglut demo is wrong to declare those PFN*PROC twice.
So, by simply commenting out those double-definition from smooth_opengl3.c, the free glut would pass the compilation phase. However, from my experience, it would not run and give some error about the GLSL.
It was also suggested that GLUT framework should be used on Mac OS X.
It´s working for me with the following parameters to configure:
./configure CFLAGS="-I/usr/X11/include/X11/extensions -L/usr/X11/lib" LIBS="-lXrandr -lXxf86vm -lXi" --with-x --x-includes=/usr/X11/include