Error trying to install rinku gem on mac - ruby-on-rails

I'm having trouble installing the rinku gem version '1.7.3' on Mavericks. I followed the advice of another post that suggested to install apple-gcc42 but that didn't help. I've also tried searching google and stack overflow but couldn't find this exact issue. Here is the error:
Building native extensions. This could take a while...
ERROR: Error installing rinku:
ERROR: Failed to build gem native extension.
/Users/home/.rvm/rubies/ruby-1.9.3-p429/bin/ruby extconf.rb
creating Makefile
make clean
make
compiling autolink.c
In file included from autolink.c:17:
buffer.h:23:20: error: stdint.h: No such file or directory
In file included from autolink.c:17:
buffer.h:41: error: expected specifier-qualifier-list before 'uint8_t'
In file included from autolink.c:18:
autolink.h:31: warning: type defaults to 'int' in declaration of 'uint8_t'
autolink.h:31: error: expected ';', ',' or ')' before '*' token
autolink.h:35: error: expected declaration specifiers or '...' before 'uint8_t'
autolink.h:39: error: expected declaration specifiers or '...' before 'uint8_t'
autolink.h:43: error: expected declaration specifiers or '...' before 'uint8_t'
autolink.c:20:20: error: string.h: No such file or directory
autolink.c:21:20: error: stdlib.h: No such file or directory
autolink.c:22:19: error: stdio.h: No such file or directory
autolink.c:23:19: error: ctype.h: No such file or directory
autolink.c:30: warning: type defaults to 'int' in declaration of 'uint8_t'
... Had to leave out some of the error because it won't let me post this without a lower code to text ratio.
autolink.c: At top level:
autolink.c:256: error: expected declaration specifiers or '...' before 'uint8_t'
autolink.c: In function 'sd_autolink__url':
autolink.c:263: error: 'data' undeclared (first use in this function)
autolink.c:266: warning: implicit declaration of function 'isalpha'
autolink.c:269: warning: implicit declaration of function 'sd_autolink_issafe'
autolink.c:272: warning: incompatible implicit declaration of built-in function 'strlen'
make: *** [autolink.o] Error 1
make failed, exit code 2

this ended up fixing it for 1.9.3
xcode-select --install

Related

Error installing kdtree

When I tried running my Ruby code with bundle install, I encountered this error: Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
I tried running gem install kdtree and gem install kdtree -v '0.3' but it throws me the same error as well. Now I am unable to run my Ruby code. Any ideas on how to resolve this. I am running on Windows machine btw. Here's the full error log:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
C:/RailsInstaller/Ruby2.1.0/bin/ruby.exe extconf.rb
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
generating kdtree-i386-mingw32.def
compiling kdtree.c
kdtree.c: In function 'kdtree_nearest0':
kdtree.c:221:13: error: expected identifier or '(' before ',' token
kdtree.c:237:14: error: expected expression before '=' token
kdtree.c:237:29: error: expected expression before '=' token
kdtree.c:239:14: error: expected expression before '=' token
kdtree.c:239:30: error: expected expression before '=' token
kdtree.c:241:34: error: expected expression before ',' token
kdtree.c:241:34: error: too few arguments to function 'kdtree_nearest0'
kdtree.c:217:13: note: declared here
kdtree.c:243:37: error: expected expression before ',' token
kdtree.c:243:37: error: too few arguments to function 'kdtree_nearest0'
kdtree.c:217:13: note: declared here
kdtree.c: In function 'kdtree_nearestk0':
kdtree.c:313:13: error: expected identifier or '(' before ',' token
kdtree.c:330:14: error: expected expression before '=' token
kdtree.c:330:29: error: expected expression before '=' token
kdtree.c:332:14: error: expected expression before '=' token
kdtree.c:332:30: error: expected expression before '=' token
kdtree.c:334:35: error: expected expression before ',' token
kdtree.c:334:35: error: too few arguments to function 'kdtree_nearestk0'
kdtree.c:309:13: note: declared here
kdtree.c:336:38: error: expected expression before ',' token
kdtree.c:336:38: error: too few arguments to function 'kdtree_nearestk0'
kdtree.c:309:13: note: declared here
kdtree.c: In function 'kdtree_persist':
kdtree.c:409:11: warning: unused variable 'str' [-Wunused-variable]
make: *** [kdtree.o] Error 1
make failed, exit code 2

builder install --without rmagick failed in openproject

I got openproject running in windows after a long struggle since new to ruby world. I cannot suggest to my colleagues until install this openproject in Oracle Linux (part of RHEL).
Checked out openproject from Git successfully using following cmd
git clone https://github.com/opf/openproject.git
cd openproject
git checkout stable
next When i run builder install --without rmagick getting following error,
...
....
.....
Using addressable 2.3.4
Using awesome_nested_set 2.1.6
Using debug_inspector 0.0.2
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby -r ./siteconf20141018-4810-1x3qn6f-0.rb extconf.rb
creating Makefile
make clean
make
gcc -I. -I/usr/lib64/ruby/1.8/x86_64-linux -I/usr/lib64/ruby/1.8/x86_64-linux -I. -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -fPIC -O0 -std=c99 -c binding_of_caller.c
binding_of_caller.c:4:21: error: vm_core.h: No such file or directory
binding_of_caller.c:5:22: error: rubys_gc.h: No such file or directory
binding_of_caller.c:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
binding_of_caller.c: In function ‘binding_memsize’:
binding_of_caller.c:34: error: ‘rb_binding_t’ undeclared (first use in this function)
binding_of_caller.c:34: error: (Each undeclared identifier is reported only once
binding_of_caller.c:34: error: for each function it appears in.)
binding_of_caller.c: In function ‘binding_free’:
binding_of_caller.c:40: error: ‘rb_binding_t’ undeclared (first use in this function)
binding_of_caller.c:40: error: ‘bind’ undeclared (first use in this function)
binding_of_caller.c:41: warning: implicit declaration of function ‘RUBY_FREE_ENTER’
binding_of_caller.c:46: warning: implicit declaration of function ‘RUBY_FREE_LEAVE’
binding_of_caller.c: In function ‘binding_mark’:
binding_of_caller.c:52: error: ‘rb_binding_t’ undeclared (first use in this function)
binding_of_caller.c:52: error: ‘bind’ undeclared (first use in this function)
binding_of_caller.c:53: warning: implicit declaration of function ‘RUBY_MARK_ENTER’
binding_of_caller.c:56: warning: implicit declaration of function ‘RUBY_MARK_UNLESS_NULL’
binding_of_caller.c:63: warning: implicit declaration of function ‘RUBY_MARK_LEAVE’
binding_of_caller.c: At top level:
binding_of_caller.c:66: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘binding_data_type’
binding_of_caller.c: In function ‘binding_alloc’:
binding_of_caller.c:77: error: ‘rb_binding_t’ undeclared (first use in this function)
binding_of_caller.c:77: error: ‘bind’ undeclared (first use in this function)
binding_of_caller.c:78: warning: implicit declaration of function ‘TypedData_Make_Struct’
binding_of_caller.c:78: error: ‘binding_data_type’ undeclared (first use in this function)
binding_of_caller.c: At top level:
binding_of_caller.c:82: error: expected ‘)’ before ‘*’ token
binding_of_caller.c:86: error: expected ‘)’ before ‘*’ token
binding_of_caller.c:90: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
binding_of_caller.c: In function ‘frametype_name’:
binding_of_caller.c:108: error: ‘VM_FRAME_MAGIC_MASK’ undeclared (first use in this function)
binding_of_caller.c:109: error: ‘VM_FRAME_MAGIC_METHOD’ undeclared (first use in this function)
binding_of_caller.c:110: error: ‘VM_FRAME_MAGIC_BLOCK’ undeclared (first use in this function)
binding_of_caller.c:111: error: ‘VM_FRAME_MAGIC_CLASS’ undeclared (first use in this function)
binding_of_caller.c:112: error: ‘VM_FRAME_MAGIC_TOP’ undeclared (first use in this function)
binding_of_caller.c:113: error: ‘VM_FRAME_MAGIC_CFUNC’ undeclared (first use in this function)
binding_of_caller.c:114: error: ‘VM_FRAME_MAGIC_PROC’ undeclared (first use in this function)
binding_of_caller.c:115: error: ‘VM_FRAME_MAGIC_IFUNC’ undeclared (first use in this function)
binding_of_caller.c:116: error: ‘VM_FRAME_MAGIC_EVAL’ undeclared (first use in this function)
binding_of_caller.c:117: error: ‘VM_FRAME_MAGIC_LAMBDA’ undeclared (first use in this function)
binding_of_caller.c: In function ‘binding_of_caller’:
binding_of_caller.c:125: error: ‘rb_thread_t’ undeclared (first use in this function)
binding_of_caller.c:125: error: ‘th’ undeclared (first use in this function)
binding_of_caller.c:126: warning: implicit declaration of function ‘GetThreadPtr’
binding_of_caller.c:128: error: ‘rb_control_frame_t’ undeclared (first use in this function)
binding_of_caller.c:128: error: ‘cfp’ undeclared (first use in this function)
binding_of_caller.c:128: warning: implicit declaration of function ‘RUBY_VM_PREVIOUS_CONTROL_FRAME’
binding_of_caller.c:129: error: ‘limit_cfp’ undeclared (first use in this function)
binding_of_caller.c:140: warning: implicit declaration of function ‘valid_frame_p’
binding_of_caller.c:141: warning: implicit declaration of function ‘find_valid_frame’
binding_of_caller.c:145: error: ‘rb_binding_t’ undeclared (first use in this function)
binding_of_caller.c:145: error: ‘bind’ undeclared (first use in this function)
binding_of_caller.c:150: warning: implicit declaration of function ‘GetBindingPtr’
binding_of_caller.c:152: warning: implicit declaration of function ‘rb_vm_make_env_object’
binding_of_caller.c:154: warning: implicit declaration of function ‘rb_vm_get_sourceline’
binding_of_caller.c: In function ‘frame_count’:
binding_of_caller.c:176: error: ‘rb_thread_t’ undeclared (first use in this function)
binding_of_caller.c:176: error: ‘th’ undeclared (first use in this function)
binding_of_caller.c:179: error: ‘rb_control_frame_t’ undeclared (first use in this function)
binding_of_caller.c:179: error: ‘cfp’ undeclared (first use in this function)
binding_of_caller.c:180: error: ‘limit_cfp’ undeclared (first use in this function)
make: *** [binding_of_caller.o] Error 1
make failed, exit code 2
Gem files will remain installed in /usr/lib64/ruby/gems/1.8/gems/binding_of_caller-0.7.2 for inspection.
Results logged to /usr/lib64/ruby/gems/1.8/extensions/x86_64-linux/1.8/binding_of_caller-0.7.2/gem_make.out
An error occurred while installing binding_of_caller (0.7.2), and Bundler cannot continue.
Make sure that `gem install binding_of_caller -v '0.7.2'` succeeds before bundling.
i cannot understand whether this error related to any dependency problem or am i checked out an wrong version.
Please help me out.
You are using a ruby version (1.8) not supported by binding_of_caller and also not supported by OpenProject . You will need to install ruby 2.1.
If possible on Oracle Linux, I would recommend doing this via RVM or rbenv.
I don't see this in the installation guide on Ubuntu, but this answer recommends:
You need to install ruby-debug first passing the include directory.
gem install ruby-debug -- --with-ruby-include=$rvm_path/src/ruby-1.9.3-p362
(adapt it to your ruby version)

Error compiling tweak in theos

I set a simple tweak using theos following the tutorial here. However when I run make with the headers from here, I get
Making all for tweak WelcomeWagon...
Preprocessing Tweak.xm...
Compiling Tweak.xm...
In file included from Tweak.xm:1:
/opt/theos//include/SpringBoard/SpringBoard.h:7:26: error: UIApplication.h: No such file or directory
cc1objplus: warnings being treated as errors
In file included from /opt/theos//include/SpringBoard/UIApplicationDelegate-Protocol.h:7,
from /opt/theos//include/SpringBoard/SpringBoard.h:9,
from Tweak.xm:1:
/opt/theos//include/SpringBoard/NSObject-Protocol.h:7: warning: duplicate declaration for protocol ‘NSObject’
In file included from /opt/theos//include/SpringBoard/SpringBoard.h:9,
from Tweak.xm:1:
/opt/theos//include/SpringBoard/UIApplicationDelegate-Protocol.h:11: warning: duplicate declaration for protocol ‘UIApplicationDelegate’
/opt/theos//include/SpringBoard/UIApplicationDelegate-Protocol.h:35: error: duplicate property declaration ‘window’
make[2]: *** [obj/Tweak.xm.o] Error 1
make[1]: *** [internal-library-all_] Error 2
make: *** [WelcomeWagon.all.tweak.variables] Error 2
After some searching around I also found that some people were using Ryan Petrich's dumped headers, so I emptied the include folder and put his headers in and ran make, with this as the output
Making all for tweak WelcomeWagon...
Preprocessing Tweak.xm...
Compiling Tweak.xm...
In file included from /opt/theos//include/QuartzCore/QuartzCore-Structs.h:11,
from /opt/theos//include/QuartzCore/CAValueFunction.h:9,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CoreAnimation.h:30,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.h:9,
from /opt/theos//include/UIKit/UIKit-Structs.h:15,
from /opt/theos//include/UIKit/UIGestureRecognizer.h:6,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISwipeGestureRecognizer.h:9,
from /opt/theos//include/UIKit/UISwipeGestureRecognizer.h:10,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITableView.h:11,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPickerView.h:11,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityAdditions.h:10,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibility.h:12,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:10,
from /opt/theos//Prefix.pch:4,
from <command-line>:0:
/opt/theos//include/IOSurface/IOSurface.h:20:36: error: IOSurface/IOSurfaceAPI.h: No such file or directory
In file included from /opt/theos//include/IOSurface/IOSurface.h:21,
from /opt/theos//include/QuartzCore/QuartzCore-Structs.h:11,
from /opt/theos//include/QuartzCore/CAValueFunction.h:9,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CoreAnimation.h:30,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.h:9,
from /opt/theos//include/UIKit/UIKit-Structs.h:15,
from /opt/theos//include/UIKit/UIGestureRecognizer.h:6,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISwipeGestureRecognizer.h:9,
from /opt/theos//include/UIKit/UISwipeGestureRecognizer.h:10,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITableView.h:11,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPickerView.h:11,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityAdditions.h:10,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibility.h:12,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:10,
from /opt/theos//Prefix.pch:4,
from <command-line>:0:
/opt/theos//include/IOSurface/IOSurfaceAccelerator.h:20: error: ‘IOSurfaceRef’ has not been declared
/opt/theos//include/IOSurface/IOSurfaceAccelerator.h:20: error: ‘IOSurfaceRef’ has not been declared
In file included from /opt/theos//include/QuartzCore/QuartzCore-Structs.h:11,
from /opt/theos//include/QuartzCore/CAValueFunction.h:9,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CoreAnimation.h:30,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.h:9,
from /opt/theos//include/UIKit/UIKit-Structs.h:15,
from /opt/theos//include/UIKit/UIGestureRecognizer.h:6,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISwipeGestureRecognizer.h:9,
from /opt/theos//include/UIKit/UISwipeGestureRecognizer.h:10,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITableView.h:11,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPickerView.h:11,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityAdditions.h:10,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibility.h:12,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:10,
from /opt/theos//Prefix.pch:4,
from <command-line>:0:
/opt/theos//include/IOSurface/IOSurface.h:27: error: variable or field ‘IOSurfaceFlushProcessorCaches’ declared void
/opt/theos//include/IOSurface/IOSurface.h:27: error: ‘IOSurfaceRef’ was not declared in this scope
In file included from /opt/theos//include/QuartzCore/CAValueFunction.h:9,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/CoreAnimation.h:30,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.h:9,
from /opt/theos//include/UIKit/UIKit-Structs.h:15,
from /opt/theos//include/UIKit/UIGestureRecognizer.h:6,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISwipeGestureRecognizer.h:9,
from /opt/theos//include/UIKit/UISwipeGestureRecognizer.h:10,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UITableView.h:11,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIPickerView.h:11,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityAdditions.h:10,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibility.h:12,
from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:10,
from /opt/theos//Prefix.pch:4,
from <command-line>:0:
/opt/theos//include/QuartzCore/QuartzCore-Structs.h:196: error: ‘IOSurfaceRef’ does not name a type
In file included from /opt/theos//include/UIKit/UIKit2.h:52,
from /opt/theos//include/MessageUI/MessageUI-Structs.h:8,
from /opt/theos//include/MessageUI/ComposeRecipient.h:9,
from /opt/theos//include/ChatKit/CKMailComposeRecipient.h:6,
from /opt/theos//include/ChatKit/ChatKit.h:41,
from /opt/theos//include/SpringBoard/SpringBoard-Structs.h:13,
from /opt/theos//include/SpringBoard/SpringBoard.h:8,
from Tweak.xm:1:
/opt/theos//include/UIKit/UIImage2.h:85: error: expected type-specifier before ‘IOSurfaceRef’
/opt/theos//include/UIKit/UIImage2.h:85: error: expected `)' before ‘IOSurfaceRef’
/opt/theos//include/UIKit/UIImage2.h:85: error: expected `;' before ‘)’ token
/opt/theos//include/UIKit/UIImage2.h:86: error: expected type-specifier before ‘IOSurfaceRef’
/opt/theos//include/UIKit/UIImage2.h:86: error: expected `)' before ‘IOSurfaceRef’
/opt/theos//include/UIKit/UIImage2.h:86: error: expected `;' before ‘)’ token
/opt/theos//include/UIKit/UIImage2.h:91: error: expected type-specifier before ‘IOSurfaceRef’
/opt/theos//include/UIKit/UIImage2.h:91: error: expected `)' before ‘IOSurfaceRef’
/opt/theos//include/UIKit/UIImage2.h:91: error: expected `;' before ‘)’ token
In file included from /opt/theos//include/UIKit/UIKit2.h:448,
from /opt/theos//include/MessageUI/MessageUI-Structs.h:8,
from /opt/theos//include/MessageUI/ComposeRecipient.h:9,
from /opt/theos//include/ChatKit/CKMailComposeRecipient.h:6,
from /opt/theos//include/ChatKit/ChatKit.h:41,
from /opt/theos//include/SpringBoard/SpringBoard-Structs.h:13,
from /opt/theos//include/SpringBoard/SpringBoard.h:8,
from Tweak.xm:1:
/opt/theos//include/UIKit/UIWindow2.h:19: error: expected type-specifier before ‘IOSurfaceRef’
/opt/theos//include/UIKit/UIWindow2.h:19: error: expected `)' before ‘IOSurfaceRef’
/opt/theos//include/UIKit/UIWindow2.h:19: error: expected `;' before ‘)’ token
/opt/theos//include/UIKit/UIWindow2.h:20: error: expected type-specifier before ‘IOSurfaceRef’
/opt/theos//include/UIKit/UIWindow2.h:20: error: expected `)' before ‘IOSurfaceRef’
/opt/theos//include/UIKit/UIWindow2.h:20: error: expected `;' before ‘)’ token
/opt/theos//include/UIKit/UIWindow2.h:21: error: expected type-specifier before ‘IOSurfaceRef’
/opt/theos//include/UIKit/UIWindow2.h:21: error: expected `)' before ‘IOSurfaceRef’
/opt/theos//include/UIKit/UIWindow2.h:21: error: expected `;' before ‘)’ token
/opt/theos//include/UIKit/UIWindow2.h:116: error: expected type-specifier before ‘IOSurfaceRef’
/opt/theos//include/UIKit/UIWindow2.h:116: error: expected `)' before ‘IOSurfaceRef’
/opt/theos//include/UIKit/UIWindow2.h:116: error: expected `;' before ‘)’ token
/opt/theos//include/UIKit/UIWindow2.h:117: error: expected type-specifier before ‘IOSurfaceRef’
/opt/theos//include/UIKit/UIWindow2.h:117: error: expected `)' before ‘IOSurfaceRef’
/opt/theos//include/UIKit/UIWindow2.h:117: error: expected `;' before ‘)’ token
make[2]: *** [obj/Tweak.xm.o] Error 1
make[1]: *** [internal-library-all_] Error 2
make: *** [WelcomeWagon.all.tweak.variables] Error 2
Could anyone tell me what I'm doing wrong? Thanks in advance.
I found the same problem with current version of Ryan Petrich's dumped headers today.
Finally I find out that the solution is,
Import the dumped Springboard headers
Copy /System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceAPI.h to /opt/theos/include/IOSurface. The reason is in IOSurface/IOSurface.h!
If you are running OS X Lion or later, you may need to comment out the following lines in /opt/theos/include/IOSurface/IOSurfaceAPI.h:
/* This call lets you get an xpcobject_t that holds a reference to the IOSurface.
Note: Any live XPC objects created from an IOSurfaceRef implicity increase the IOSurface's global use
count by one until the object is destroyed. */
// xpc_object_t IOSurfaceCreateXPCObject(IOSurfaceRef aSurface)
// IOSFC_AVAILABLE_STARTING(_MAC_10_7, __IPHONE_NA);
/* This call lets you take an xpcobject_t created via IOSurfaceCreatePort() and recreate an IOSurfaceRef from it. */
// IOSurfaceRef IOSurfaceLookupFromXPCObject(xpc_object_t xobj)
// IOSFC_AVAILABLE_STARTING(_MAC_10_7, __IPHONE_NA);
Give it a try!
I just did this today 02/13/2013 and found the above to be somewhat helpful. With a little brains and the help of Google I found that what you need to do is :
1.) Get the headers - use a Google search for "Ryan Petrich's dumped headers" which will lead you to :https://github.com/rpetrich/iphoneheaders
2.) Use git to clone the repo : git clone https://github.com/rpetrich/iphoneheaders
3.) run make ( I found that I needed to run make as sudo make due to the location of theos being installed under /opt. )
4.) For each "error file not found" I copied the include files into my project.
5.) I believe you should end up with the following folders in your project folder :
AccountSettings IOKit SpringBoard
ActorKit IOSurface TelephonyUI
AppSupport JavaScriptCore Tutorial.plist
Availability2.h MIME Tweak.xm
ChatKit Makefile Tweak.xm.original
CoreFoundation MediaPlayer UIKit
CoreGraphics Message WebCore
DAVKit MessageUI WebKit
DataAccess MusicLibrary control
Foundation PhotoLibrary obj
GraphicsServices QuartzCore theos
6.) You need to do #2 from the answer above "Copy /System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceAPI.h to /opt/theos/include/IOSurface. The reason is in IOSurface/IOSurface.h!"
7.) You also need to make the edit from the answer above "If you are running OS X Lion, you may need to comment out the following lines in /opt/theos/include/IOSurface/IOSurfaceAPI.h:"
/* This call lets you get an xpcobject_t that holds a reference to the IOSurface.
Note: Any live XPC objects created from an IOSurfaceRef implicity increase the IOSurface's global use
count by one until the object is destroyed. */
// xpc_object_t IOSurfaceCreateXPCObject(IOSurfaceRef aSurface)
// IOSFC_AVAILABLE_STARTING(_MAC_10_7, __IPHONE_NA);
/* This call lets you take an xpcobject_t created via IOSurfaceCreatePort() and recreate an IOSurfaceRef from it. */
// IOSurfaceRef IOSurfaceLookupFromXPCObject(xpc_object_t xobj)
// IOSFC_AVAILABLE_STARTING(_MAC_10_7, __IPHONE_NA);
FYI in my IOSurfaceAPI.h these were lines around line number 252/253
You don't need to import the dumped Springboard headers.

OpenKinect: Cannot build RGBDemo

I am following the instructions given in the book "Hacking the Kinect" pages 15-16 (Apress 2011) to install the RGB Demo (version 0.5.0) on my system (32bit x86 machine running Xubuntu 12.04).
I downloaded and extracted the demo's source and installed the needed packages as described within the book:
libboost-all-dev, libusb-1.0-0-dev, libqt4-dev, libgtk2.0-dev, cmake, ccmake (from cmake-curses-gui), libglew1.5-dev, libgsl0-dev, freeglut3-dev (not libglut3-dev as stated in the book), and libxmu-dev.
Note book typo: libgs10-dev should actually read libgsl0-dev.
When running ccmake on the source's root directory, I set the flags as given by the book:
BUILD_EXAMPLES ON
BUILD_FAKENECT ON
BUILD_SHARED_LIBS ON
NESTK_USE_FREENECT ON
NESTK_USE_OPENNI OFF
NESTK_USE_PCL OFF
and leave all other flags as their defaults.
I then proceed to configure and generate without issue, but when subsequently running make, I run into the following error:
[ 35%] Building CXX object nestk/deps/opencv/modules/core/CMakeFiles/opencv_core.dir/src/out.o
In file included from /home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/src/precomp.hpp:55:0,
from /home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/src/out.cpp:43:
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:354:13: error: ‘ptrdiff_t’ does not name a type
In file included from /home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/src/precomp.hpp:55:0,
from /home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/src/out.cpp:43:
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2600:13: error: ‘ptrdiff_t’ does not name a type
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2623:24: error: declaration of ‘operator[]’ as non-function
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2623:22: error: expected ‘;’ at end of member declaration
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2623:34: error: expected ‘)’ before ‘i’
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2626:36: error: declaration of ‘operator+=’ as non-function
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2626:32: error: expected ‘;’ at end of member declaration
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2626:46: error: expected ‘)’ before ‘ofs’
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2628:36: error: declaration of ‘operator-=’ as non-function
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2628:32: error: expected ‘;’ at end of member declaration
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2628:46: error: expected ‘)’ before ‘ofs’
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2641:5: error: ‘ptrdiff_t’ does not name a type
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2642:15: error: ‘ptrdiff_t’ has not been declared
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2661:13: error: ‘ptrdiff_t’ does not name a type
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2684:21: error: ‘ptrdiff_t’ has not been declared
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2687:37: error: declaration of ‘operator+=’ as non-function
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2687:33: error: expected ‘;’ at end of member declaration
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2687:47: error: expected ‘)’ before ‘ofs’
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2689:37: error: declaration of ‘operator-=’ as non-function
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2689:33: error: expected ‘;’ at end of member declaration
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2689:47: error: expected ‘)’ before ‘ofs’
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2733:22: error: declaration of ‘operator[]’ as non-function
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2733:20: error: expected ‘;’ at end of member declaration
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2733:32: error: expected ‘)’ before ‘i’
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2736:32: error: declaration of ‘operator+=’ as non-function
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2736:28: error: expected ‘;’ at end of member declaration
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2736:42: error: expected ‘)’ before ‘ofs’
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2738:32: error: declaration of ‘operator-=’ as non-function
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2738:28: error: expected ‘;’ at end of member declaration
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2738:42: error: expected ‘)’ before ‘ofs’
In file included from /home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:4047:0,
from /home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/src/precomp.hpp:55,
from /home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/src/out.cpp:43:
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/operations.hpp:2822:15: error: ‘ptrdiff_t’ does not name a type
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/operations.hpp:3383:31: error: ‘ptrdiff_t’ does not name a type
In file included from /home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:4048:0,
from /home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/src/precomp.hpp:55,
from /home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/src/out.cpp:43:
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/mat.hpp:1629:57: error: declaration of ‘operator+=’ as non-function
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/mat.hpp:1629:57: error: ‘ptrdiff_t’ was not declared in this scope
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/mat.hpp:1629:57: note: suggested alternatives:
/usr/include/c++/4.6/i686-linux-gnu/./bits/c++config.h:156:28: note: ‘std::ptrdiff_t’
/usr/include/c++/4.6/i686-linux-gnu/./bits/c++config.h:156:28: note: ‘std::ptrdiff_t’
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/src/out.cpp:305:1: error: expected ‘}’ at end of input
make[2]: *** [nestk/deps/opencv/modules/core/CMakeFiles/opencv_core.dir/src/out.o] Error 1
make[1]: *** [nestk/deps/opencv/modules/core/CMakeFiles/opencv_core.dir/all] Error 2
make: *** [all] Error 2
What is causing these errors and how do I resolve them?
Could it be as simple as opencv/modules/core/include/opencv2/core/core.hpp missing #include <stddef.h>?
Yeah just edit the core.hpp /home/linaro/Downloads/RGBDemo-0.4.0-Source/nestk/deps/opencv/modules/core/include/opencv2/core and add the line
#include <stddef.h

Ruby on Rails - Error installing bdb. Failed to build gem native extension

When running gem install bdb I get the following error:
Error installing bdb:
ERROR: Failed to build gem native extension.
Anyone know where I can find the bdb library for Mac OS X?
Full error:
Building native extensions. This could take a while...
ERROR: Error installing bdb:
ERROR: Failed to build gem native extension.
...
checking for db_version() in -ldb-5.1... yes
Writing bdb_aux._c (defines), this takes a while
don't know how to handle DB_DEGREE_2 DB_READ_COMMITTED, guessing UINT
don't know how to handle DB_DIRTY_READ DB_READ_UNCOMMITTED, guessing UINT
don't know how to handle DB_HEAP_RID_SZ (sizeof(db_pgno_t) + sizeof(db_indx_t)), guessing UINT
wrote 491 defines
creating Makefile
make
...
bdb.c:84:1: warning: "eDbE_create" redefined
bdb.c:50:1: warning: this is the location of the previous definition
bdb.c: In function ‘assoc_rescue’:
bdb.c:1200: warning: format not a string literal and no format arguments
bdb.c: In function ‘assoc_callback’:
bdb.c:1248: warning: comparison between signed and unsigned
bdb.c:1249: warning: pointer of type ‘void *’ used in arithmetic
bdb.c: In function ‘env_set_cachesize’:
bdb.c:1830: warning: implicit conversion shortens 64-bit value into a 32-bit value
bdb.c:1831: warning: implicit conversion shortens 64-bit value into a 32-bit value
bdb.c: In function ‘env_txn_stat’:
bdb.c:2299: warning: comparison between signed and unsigned
bdb.c: In function ‘env_repmgr_set_local_site’:
bdb.c:3005: error: ‘DB_ENV’ has no member named ‘repmgr_set_local_site’
bdb.c: In function ‘env_repmgr_add_remote_site’:
bdb.c:3024: error: ‘DB_ENV’ has no member named ‘repmgr_add_remote_site’
bdb.c:3331:1: warning: "eDbE_create" redefined
bdb.c:84:1: warning: this is the location of the previous definition
bdb.c:3424:1: warning: "ENV_LOG_CONFIG_FUNC" redefined
bdb.c:2533:1: warning: this is the location of the previous definition
make: *** [bdb.o] Error 1
Did you see the instructions on the bdb page?
As a Gem
At the moment this library is not available on RubyForge. To install
it as a gem, do the following:
[sudo] gem install bdb
For Berkeley DB v4.7 installed from MacPorts do
the following:
[sudo] env ARCHFLAGS="-arch i386" gem install bdb This assumes you're
on OS X and BerkeleyDB wasn't compiled as a universal binary.
So it looks like you need to install berkeley db via macports/brew to get the Gem to install.

Resources