Failed to incorporate iOS SDK - xtify

XCODE 6.0.1
IBM Push Notification SDK for Apple iOS 2.7.3
I created new project(So my app is just hello world app), and I followed the steps below.
Implement the IBM Push Notification SDK for Apple iOS within your App
http://developer.xtify.com/display/sdk/Getting+Started+with+Apple+Push+Notification+Service#GettingStartedwithApplePushNotificationService-Implementthe%C2%A0IBMPushNotificationSDKforAppleiOSwithinyourApp
I added following property to info.plist.
NSLocationWhenInUseUsageDescription
NSLocationAlwaysUsageDescription
I added "-fno-objc-arc" compiler flag to below files since the ARC is valid in myproject.
CompanyInboxViewCell.m
CompanyCustomInbox.m
CompanyInboxVC.m
CompanyDetailsVC.m
AppDelegate.m
I built it. Then I got following errors in "registerForPush method", which is in "XLXtifyOptions.m" file.
capture is here
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:107:5: error: use of undeclared identifier 'UIApplication'
UIApplication * app = [UIApplication sharedApplication];
^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:107:21: error: use of undeclared identifier 'app'
UIApplication * app = [UIApplication sharedApplication];
^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:107:28: error: use of undeclared identifier 'UIApplication'
UIApplication * app = [UIApplication sharedApplication];
^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:110:9: error: use of undeclared identifier 'app'
if([app respondsToSelector:#selector(registerForRemoteNotifications)])
^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:112:9: error: use of undeclared identifier 'UIUserNotificationType'
UIUserNotificationType types = UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert;
^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:113:9: error: use of undeclared identifier 'UIUserNotificationSettings'
UIUserNotificationSettings * settings = [UIUserNotificationSettings settingsForTypes:types categories:nil];
^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:113:38: error: use of undeclared identifier 'settings'
UIUserNotificationSettings * settings = [UIUserNotificationSettings settingsForTypes:types categories:nil];
^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:113:50: error: use of undeclared identifier 'UIUserNotificationSettings'
UIUserNotificationSettings * settings = [UIUserNotificationSettings settingsForTypes:types categories:nil];
^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:114:10: error: use of undeclared identifier 'app'
[app registerUserNotificationSettings: settings];
^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:115:10: error: use of undeclared identifier 'app'
[app registerForRemoteNotifications];
^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:120:9: error: use of undeclared identifier 'UIRemoteNotificationType'
UIRemoteNotificationType types = UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound |UIRemoteNotificationTypeAlert;
^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:122:13: error: use of undeclared identifier 'types'
types = UIRemoteNotificationTypeNewsstandContentAvailability | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound |UIRemoteNotificationTypeAlert;
^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:122:21: error: use of undeclared identifier 'UIRemoteNotificationTypeNewsstandContentAvailability'
types = UIRemoteNotificationTypeNewsstandContentAvailability | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound |UIRemoteNotificationTypeAlert;
^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:122:76: error: use of undeclared identifier 'UIRemoteNotificationTypeBadge'
types = UIRemoteNotificationTypeNewsstandContentAvailability | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound |UIRemoteNotificationTypeAlert;
^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:122:108: error: use of undeclared identifier 'UIRemoteNotificationTypeSound'
types = UIRemoteNotificationTypeNewsstandContentAvailability | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound |UIRemoteNotificationTypeAlert;
^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:122:139: error: use of undeclared identifier 'UIRemoteNotificationTypeAlert'
types = UIRemoteNotificationTypeNewsstandContentAvailability | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound |UIRemoteNotificationTypeAlert;
^
/Users/username/Documents/objectiveCpractice/appname/XtifyLib/XLXtifyOptions.m:123:10: error: use of undeclared identifier 'app'
[app registerForRemoteNotificationTypes:types];
Any ideas?
Thanks in advance!

It seems that "#import '<'UIKit/UIKit.h'>'" is correct solution.IBM Push Notification SDK for Apple iOS 2.7.3 was updated to 2.7.4. "XLXtifyOptions.m" of 2.7.4 version import UIKit/UIKit.h.
After that, I succeeded to build. But I got following error when I executed it.
[XLappMgr init]
2014-11-12 13:40:38.811 XtifyApp[479:95045] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[NSPlaceholderString initWithString:]: nil argument'
*** First throw call stack:
(0x181d9e084 0x1923d40e4 0x181d9dfc4 0x182b9d8b4 0x10004ef0c 0x10004e738 0x10003f784 0x1865864a4 0x100042608 0x192a42a08)
libc++abi.dylib: terminating with uncaught exception of type NSException
I added "Bundle display name" property to info.plist. Then above error is gone.
Thanks.

Related

ZeroMQ gem fails to install on macOS Catalina

I am trying to install and use zeroMQ gem on macOS 10.15.3. But I get a build error, see last code fragment.
I install using bundle like so: bundle install --path vendor/bundle and my Gemfile like this:
source "https://rubygems.org"
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
gem "sinatra"
gem "pg"
gem "zmq"
But the gem install of zeroMQ fails.
What I find weird is that both raw C zeroMQ, cppzmq, and I could install zeroMQ for python using PIP without any problems. zeroMQ is installed using Homebrew.
Any insights is appriciated.
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/larsnielsen/git/au/alexandria-storage-node/vendor/bundle/ruby/2.6.0/gems/zmq-2.1.4
/Users/larsnielsen/.rbenv/versions/2.6.5/bin/ruby -I /Users/larsnielsen/.rbenv/versions/2.6.5/lib/ruby/2.6.0 -r ./siteconf20200305-37449-pikzw8.rb extconf.rb
checking for zmq.h... yes
checking for zmq_init() in -lzmq... yes
Cool, I found your zmq install...
creating Makefile
current directory: /Users/larsnielsen/git/au/alexandria-storage-node/vendor/bundle/ruby/2.6.0/gems/zmq-2.1.4
make "DESTDIR=" clean
current directory: /Users/larsnielsen/git/au/alexandria-storage-node/vendor/bundle/ruby/2.6.0/gems/zmq-2.1.4
make "DESTDIR="
compiling rbzmq.c
rbzmq.c:105:12: warning: 'rb_data_object_alloc' is deprecated: by rb_data_object_wrap [-Wdeprecated-declarations]
return rb_data_object_alloc (class_, NULL, 0, context_free);
^
/Users/larsnielsen/.rbenv/versions/2.6.5/include/ruby-2.6.0/ruby/ruby.h:1437:1: note: 'rb_data_object_alloc' has been explicitly marked deprecated here
DEPRECATED_BY(rb_data_object_wrap, static inline VALUE rb_data_object_alloc(VALUE,void*,RUBY_DATA_FUNC,RUBY_DATA_FUNC));
^
/Users/larsnielsen/.rbenv/versions/2.6.5/include/ruby-2.6.0/x86_64-darwin19/ruby/config.h:139:44: note: expanded from macro 'DEPRECATED_BY'
#define DEPRECATED_BY(n,x) __attribute__ ((__deprecated__("by "#n))) x
^
rbzmq.c:324:9: warning: implicit declaration of function 'rb_thread_blocking_region' is invalid in C99 [-Wimplicit-function-declaration]
rb_thread_blocking_region (zmq_poll_blocking, (void*)&poll_args, NULL, NULL);
^
rbzmq.c:968:7: error: use of undeclared identifier 'ZMQ_RECOVERY_IVL_MSEC'
case ZMQ_RECOVERY_IVL_MSEC:
^
rbzmq.c:990:10: error: use of undeclared identifier 'ZMQ_HWM'
case ZMQ_HWM:
^
rbzmq.c:991:10: error: use of undeclared identifier 'ZMQ_SWAP'
case ZMQ_SWAP:
^
rbzmq.c:995:10: error: use of undeclared identifier 'ZMQ_MCAST_LOOP'
case ZMQ_MCAST_LOOP:
^
rbzmq.c:1292:10: error: use of undeclared identifier 'ZMQ_HWM'
case ZMQ_HWM:
^
rbzmq.c:1293:10: error: use of undeclared identifier 'ZMQ_SWAP'
case ZMQ_SWAP:
^
rbzmq.c:1297:10: error: use of undeclared identifier 'ZMQ_MCAST_LOOP'
case ZMQ_MCAST_LOOP:
^
rbzmq.c:1315:10: error: use of undeclared identifier 'ZMQ_RECOVERY_IVL_MSEC'
case ZMQ_RECOVERY_IVL_MSEC:
^
rbzmq.c:1443:81: error: too few arguments to function call, expected 4, have 3
send_args->rc = zmq_send(send_args->socket, send_args->msg, send_args->flags);
~~~~~~~~ ^
/usr/local/include/zmq.h:489:1: note: 'zmq_send' declared here
ZMQ_EXPORT int zmq_send (void *s_, const void *buf_, size_t len_, int flags_);
^
/usr/local/include/zmq.h:90:20: note: expanded from macro 'ZMQ_EXPORT'
#define ZMQ_EXPORT __attribute__ ((visibility ("default")))
^
rbzmq.c:1512:9: warning: implicit declaration of function 'rb_thread_blocking_region' is invalid in C99 [-Wimplicit-function-declaration]
rb_thread_blocking_region (zmq_send_blocking, (void*) &send_args, NULL, NULL);
^
rbzmq.c:1517:38: error: too few arguments to function call, expected 4, have 3
rc = zmq_send (s, &msg, flags);
~~~~~~~~ ^
/usr/local/include/zmq.h:489:1: note: 'zmq_send' declared here
ZMQ_EXPORT int zmq_send (void *s_, const void *buf_, size_t len_, int flags_);
^
/usr/local/include/zmq.h:90:20: note: expanded from macro 'ZMQ_EXPORT'
#define ZMQ_EXPORT __attribute__ ((visibility ("default")))
^
rbzmq.c:1541:81: error: too few arguments to function call, expected 4, have 3
recv_args->rc = zmq_recv(recv_args->socket, recv_args->msg, recv_args->flags);
~~~~~~~~ ^
/usr/local/include/zmq.h:492:1: note: 'zmq_recv' declared here
ZMQ_EXPORT int zmq_recv (void *s_, void *buf_, size_t len_, int flags_);
^
/usr/local/include/zmq.h:90:20: note: expanded from macro 'ZMQ_EXPORT'
#define ZMQ_EXPORT __attribute__ ((visibility ("default")))
^
rbzmq.c:1596:9: warning: implicit declaration of function 'rb_thread_blocking_region' is invalid in C99 [-Wimplicit-function-declaration]
rb_thread_blocking_region (zmq_recv_blocking, (void*) &recv_args,
^
rbzmq.c:1602:38: error: too few arguments to function call, expected 4, have 3
rc = zmq_recv (s, &msg, flags);
~~~~~~~~ ^
/usr/local/include/zmq.h:492:1: note: 'zmq_recv' declared here
ZMQ_EXPORT int zmq_recv (void *s_, void *buf_, size_t len_, int flags_);
^
/usr/local/include/zmq.h:90:20: note: expanded from macro 'ZMQ_EXPORT'
#define ZMQ_EXPORT __attribute__ ((visibility ("default")))
^
rbzmq.c:1675:50: error: use of undeclared identifier 'ZMQ_HWM'
rb_define_const (zmq_module, "HWM", INT2NUM (ZMQ_HWM));
^
rbzmq.c:1676:51: error: use of undeclared identifier 'ZMQ_SWAP'
rb_define_const (zmq_module, "SWAP", INT2NUM (ZMQ_SWAP));
^
rbzmq.c:1683:57: error: use of undeclared identifier 'ZMQ_MCAST_LOOP'
rb_define_const (zmq_module, "MCAST_LOOP", INT2NUM (ZMQ_MCAST_LOOP));
^
rbzmq.c:1698:64: error: use of undeclared identifier 'ZMQ_RECOVERY_IVL_MSEC'
rb_define_const (zmq_module, "RECOVERY_IVL_MSEC", INT2NUM (ZMQ_RECOVERY_IVL_MSEC));
^
4 warnings and 16 errors generated.
make: *** [rbzmq.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/larsnielsen/git/au/alexandria-storage-node/vendor/bundle/ruby/2.6.0/gems/zmq-2.1.4 for inspection.
Results logged to /Users/larsnielsen/git/au/alexandria-storage-node/vendor/bundle/ruby/2.6.0/extensions/x86_64-darwin-19/2.6.0-static/zmq-2.1.4/gem_make.out
An error occurred while installing zmq (2.1.4), and Bundler cannot continue.
Make sure that `gem install zmq -v '2.1.4' --source 'https://rubygems.org/'` succeeds before bundling.
The zmq gem is very old: https://rubygems.org/gems/zmq - last update was performed in 2010. There are numerous known compatibility problems, see for example: https://github.com/zeromq/rbzmq/issues/32.
I would recommend you use gem rbczmq instead: https://github.com/methodmissing/rbczmq
I had no problem getting ffi-rzmq running.
https://github.com/chuckremes/ffi-rzmq
gem install ffi-rzmq

macOS Mojave throws error: use of undeclared identifier 'errno' when running ruby-build

I'm trying to upgrade ruby on my system to 2.6.1 using rbenv, but I keep getting an error that I can't figure out.
I upgraded my system to the latest macOS version (10.14.3) and made sure Xcode 10.1 and the CLI tools were installed as well. I removed ruby-build and rbenv via homebrew and reinstalled with the latest versions. I'm still getting the error.
Here is the portion of the log that shows the error:
compiling enumerator.c
cont.c:897:9: error: use of undeclared identifier 'errno'
errno = 0;
^
cont.c:900:80: error: use of undeclared identifier 'errno'
rb_raise(rb_eFiberError, "can't alloc machine stack to fiber: %s", ERRNOMSG);
^
cont.c:862:27: note: expanded from macro 'ERRNOMSG'
#define ERRNOMSG strerror(errno)
^
cont.c:906:68: error: use of undeclared identifier 'errno'
rb_raise(rb_eFiberError, "can't set a guard page: %s", ERRNOMSG);
^
cont.c:862:27: note: expanded from macro 'ERRNOMSG'
#define ERRNOMSG strerror(errno)
^
3 errors generated.
make: *** [cont.o] Error 1
make: *** Waiting for unfinished jobs....
dir.c:562:10: error: use of undeclared identifier 'errno'
int e = errno;
^
dir.c:567:16: error: use of undeclared identifier 'EIO'
else if (e == EIO) {
^
dir.c:788:5: error: use of undeclared identifier 'errno'
errno = 0;
^
dir.c:793:10: error: use of undeclared identifier 'errno'
int e = errno;
^
dir.c:1363:17: error: use of undeclared identifier 'ENOENT'
return e == ENOENT || e == ENOTDIR;
^
dir.c:1363:32: error: use of undeclared identifier 'ENOTDIR'
return e == ENOENT || e == ENOTDIR;
^
dir.c:1401:35: error: use of undeclared identifier 'errno'
if (ret < 0 && !to_be_ignored(errno))
^
dir.c:1416:35: error: use of undeclared identifier 'errno'
if (ret < 0 && !to_be_ignored(errno))
^
dir.c:1463:10: error: use of undeclared identifier 'errno'
int e = errno;
^
dir.c:1516:10: error: use of undeclared identifier 'errno'
int e = errno;
^
dir.c:1804:21: error: use of undeclared identifier 'errno'
if (!to_be_ignored(errno))
^
dir.c:1993:18: error: use of undeclared identifier 'EACCES'
if (error == EACCES) {
^
dir.c:2221:42: error: use of undeclared identifier 'errno'
if ((magical < 2) && !recursive && (errno == EACCES)) {
^
dir.c:2221:51: error: use of undeclared identifier 'EACCES'
if ((magical < 2) && !recursive && (errno == EACCES)) {
^
dir.c:3292:10: error: use of undeclared identifier 'errno'
int e = errno;
^
15 errors generated.
make: *** [dir.o] Error 1
Has anyone else seen this error? I checked the ruby-build issues on Github. It looks like someone else has a similar issue, but not this specific one.

error ‘underlying_type_t’ in namespace ‘std’ does not name a template type in example.cpp from project-OSRM

I try to execute the examle.cpp file of Project-OSRM. I did the following steps:
build OSRM from source as described here
in new terminal: cd osrm-backend/example
in the terminal: cmake ..
in the terminal: cmake --build .
in the terminal: sudo cmake --build . --target install
move the maps contractor, engine, extractor, partition, storage, util from /usr/local/include/osrm to /usr/local/include (else error maps are not in /usr/local/include)
in the terminal: g++ -std=c++11 example.cpp -o example
But I get the error
‘underlying_type_t’ in namespace ‘std’ does not name a template type
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>
Does anyone have a idea what I'm doing wrong or what is going wrong and how to solve this?
Error message
In file included from /usr/local/include/engine/api/match_parameters.hpp:31:0,
from /usr/local/include/osrm/match_parameters.hpp:31,
from example.cpp:1:
/usr/local/include/engine/api/route_parameters.hpp: In function ‘bool osrm::engine::api::operator&(osrm::engine::api::RouteParameters::AnnotationsType, osrm::engine::api::RouteParameters::AnnotationsType)’:
/usr/local/include/engine/api/route_parameters.hpp:144:26: error: ‘underlying_type_t’ in namespace ‘std’ does not name a template type
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(l
^
/usr/local/include/engine/api/route_parameters.hpp:144:43: error: expected ‘>’ before ‘<’ token
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(l
^
/usr/local/include/engine/api/route_parameters.hpp:144:43: error: expected ‘(’ before ‘<’ token
/usr/local/include/engine/api/route_parameters.hpp:144:43: error: expected primary-expression before ‘<’ token
/usr/local/include/engine/api/route_parameters.hpp:144:76: error: expected primary-expression before ‘>>’ token
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(lhs) &
^
/usr/local/include/engine/api/route_parameters.hpp:145:26: error: ‘underlying_type_t’ in namespace ‘std’ does not name a template type
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(r
^
/usr/local/include/engine/api/route_parameters.hpp:145:43: error: expected ‘>’ before ‘<’ token
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(r
^
/usr/local/include/engine/api/route_parameters.hpp:145:43: error: expected ‘(’ before ‘<’ token
/usr/local/include/engine/api/route_parameters.hpp:145:43: error: expected primary-expression before ‘<’ token
/usr/local/include/engine/api/route_parameters.hpp:145:76: error: expected primary-expression before ‘>>’ token
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(rhs));
^
/usr/local/include/engine/api/route_parameters.hpp:145:84: error: expected ‘)’ before ‘;’ token
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(rhs));
^
/usr/local/include/engine/api/route_parameters.hpp:145:84: error: expected ‘)’ before ‘;’ token
/usr/local/include/engine/api/route_parameters.hpp: In function ‘osrm::engine::api::RouteParameters::AnnotationsType osrm::engine::api::operator|(osrm::engine::api::RouteParameters::AnnotationsType, osrm::engine::api::RouteParameters::AnnotationsType)’:
/usr/local/include/engine/api/route_parameters.hpp:152:26: error: ‘underlying_type_t’ in namespace ‘std’ does not name a template type
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(l
^
/usr/local/include/engine/api/route_parameters.hpp:152:43: error: expected ‘>’ before ‘<’ token
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(l
^
/usr/local/include/engine/api/route_parameters.hpp:152:43: error: expected ‘(’ before ‘<’ token
/usr/local/include/engine/api/route_parameters.hpp:152:43: error: expected primary-expression before ‘<’ token
/usr/local/include/engine/api/route_parameters.hpp:152:76: error: expected primary-expression before ‘>>’ token
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(lhs) |
^
/usr/local/include/engine/api/route_parameters.hpp:153:26: error: ‘underlying_type_t’ in namespace ‘std’ does not name a template type
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(r
^
/usr/local/include/engine/api/route_parameters.hpp:153:43: error: expected ‘>’ before ‘<’ token
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(r
^
/usr/local/include/engine/api/route_parameters.hpp:153:43: error: expected ‘(’ before ‘<’ token
/usr/local/include/engine/api/route_parameters.hpp:153:43: error: expected primary-expression before ‘<’ token
/usr/local/include/engine/api/route_parameters.hpp:153:76: error: expected primary-expression before ‘>>’ token
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(rhs));
^
/usr/local/include/engine/api/route_parameters.hpp:153:84: error: expected ‘)’ before ‘;’ token
static_cast<std::underlying_type_t<RouteParameters::AnnotationsType>>(rhs));
^
/usr/local/include/engine/api/route_parameters.hpp:153:84: error: expected ‘)’ before ‘;’ token
underlying_type_t requires C++14. To be able to use it pass -std=c++14 to your compiler.
Don't forget to
#include <type_traits>
This missing directive also lead to the same (confusing) error message.

Really impossible to make package with Theos

I really don't manage to "make package" with Theos for a Tweak made by me, so I copied the "unlockchanger" example on the web (here https://github.com/codyd51/Theos-Examples/tree/master/unlockchanger ) and tried to do "make package". I get these errors:
iPhone-di-Gabriele:/var/mobile/unlockchanger root# make package
/var/mobile/unlockchanger/theos/makefiles/targets/Darwin-arm/iphone.mk:43: Targeting iOS 4.0 and higher is not supported with iphone-gcc. Forcing clang.
/var/mobile/unlockchanger/theos/makefiles/targets/Darwin-arm/iphone.mk:53: Deploying to iOS 3.0 while building for 6.0 will generate armv7-only binaries.
Making all for tweak UnlockChanger...
Preprocessing Tweak.xm...
Compiling Tweak.xm...
In file included from Tweak.xm:3:
/var/mobile/unlockchanger/theos/include/substrate.h:57:20: error: unknown type name 'pid_t'
bool MSHookProcess(pid_t pid, const char *library);
^
/var/mobile/unlockchanger/theos/include/substrate.h:69:1: error: unknown type name 'IMP'
IMP MSHookMessage(Class _class, SEL sel, IMP imp, const char *prefix _default(NULL));
^
/var/mobile/unlockchanger/theos/include/substrate.h:69:42: error: unknown type name 'IMP'
IMP MSHookMessage(Class _class, SEL sel, IMP imp, const char *prefix _default(NULL));
^
/var/mobile/unlockchanger/theos/include/substrate.h:69:79: error: use of undeclared identifier 'NULL'
IMP MSHookMessage(Class _class, SEL sel, IMP imp, const char *prefix _default(NULL));
^
/var/mobile/unlockchanger/theos/include/substrate.h:48:27: note: expanded from macro '_default'
#define _default(value) = value
^
/var/mobile/unlockchanger/theos/include/substrate.h:71:45: error: unknown type name 'IMP'
void MSHookMessageEx(Class _class, SEL sel, IMP imp, IMP *result);
^
/var/mobile/unlockchanger/theos/include/substrate.h:71:54: error: unknown type name 'IMP'
void MSHookMessageEx(Class _class, SEL sel, IMP imp, IMP *result);
^
/var/mobile/unlockchanger/theos/include/substrate.h:125:92: error: use of undeclared identifier 'NULL'
static inline Type_ *MSHookMessage(Class _class, SEL sel, Type_ *imp, const char *prefix = NULL) {
^
/var/mobile/unlockchanger/theos/include/substrate.h:126:82: error: unknown type name 'IMP'
return reinterpret_cast<Type_ *>(MSHookMessage(_class, sel, reinterpret_cast<IMP>(imp), prefix));
^
/var/mobile/unlockchanger/theos/include/substrate.h:132:58: error: unknown type name 'IMP'
return MSHookMessageEx(_class, sel, reinterpret_cast<IMP>(imp), reinterpret_cast<IMP *>(result));
^
/var/mobile/unlockchanger/theos/include/substrate.h:132:86: error: unknown type name 'IMP'
return MSHookMessageEx(_class, sel, reinterpret_cast<IMP>(imp), reinterpret_cast<IMP *>(result));
^
/var/mobile/unlockchanger/theos/include/substrate.h:137:5: error: use of undeclared identifier 'Ivar'
Ivar ivar(class_getInstanceVariable(object_getClass(self), name));
^
/var/mobile/unlockchanger/theos/include/substrate.h:138:19: error: use of undeclared identifier 'ivar'
void *pointer(ivar == NULL ? NULL : reinterpret_cast<char *>(self) + ivar_getOffset(ivar));
^
/var/mobile/unlockchanger/theos/include/substrate.h:138:27: error: use of undeclared identifier 'NULL'
void *pointer(ivar == NULL ? NULL : reinterpret_cast<char *>(self) + ivar_getOffset(ivar));
^
/var/mobile/unlockchanger/theos/include/substrate.h:138:34: error: use of undeclared identifier 'NULL'
void *pointer(ivar == NULL ? NULL : reinterpret_cast<char *>(self) + ivar_getOffset(ivar));
^
/var/mobile/unlockchanger/theos/include/substrate.h:138:89: error: use of undeclared identifier 'ivar'
void *pointer(ivar == NULL ? NULL : reinterpret_cast<char *>(self) + ivar_getOffset(ivar));
^
/var/mobile/unlockchanger/theos/include/substrate.h:294:71: error: use of undeclared identifier 'NULL'
return MSHookFunction(symbol, replace, reinterpret_cast<Type_ **>(NULL));
^
/var/mobile/unlockchanger/theos/include/substrate.h:298:85: error: use of undeclared identifier 'NULL'
static inline void MSHookSymbol(Type_ *&value, const char *name, MSImageRef image = NULL) {
^
/var/mobile/unlockchanger/theos/include/substrate.h:303:86: error: use of undeclared identifier 'NULL'
static inline void MSHookFunction(const char *name, Type_ *replace, Type_ **result = NULL) {
^
/var/mobile/unlockchanger/theos/include/substrate.h:310:104: error: use of undeclared identifier 'NULL'
static inline void MSHookFunction(MSImageRef image, const char *name, Type_ *replace, Type_ **result = NULL) {
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [obj/Tweak.xm.7838be1a.o] Error 1
make[1]: *** [internal-library-all_] Error 2
make: *** [UnlockChanger.all.tweak.variables] Error 2
Some detail:
I'm on iOS8.1, with an iPhone 5. Everything installed from Cydia
..and on Windows 8.1 with WinSCP and PuTTY
I've installed Theos, Perl.. everything (Also "BigBoss recommended packages")
I had to install also LLVM+Clang because make didn't find a "clang++" command
I've tried to dump classes, instead of taking them from the web
I've updated substrate.h in /include/ and libsubstrate.dylib in /lib/
If I try to "make package" on my tweak for SpringBoard, where in Tweak.xm I do:
#import <SpringBoard/Springboard.h>
I get these errors:
iPhone-di-Gabriele:/var/mobile/mytweak root# make package
/var/mobile/mytweak/theos/makefiles/targets/Darwin-arm/iphone.mk:43: Targeting iOS 4.0 and higher is not supported with iphone-gcc. Forcing clang.
/var/mobile/mytweak/theos/makefiles/targets/Darwin-arm/iphone.mk:53: Deploying to iOS 3.0 while building for 6.0 will generate armv7-only binaries.
Making all for tweak mytweak...
Preprocessing Tweak.xm...
Compiling Tweak.xm...
In file included from Tweak.xm:1:
/var/mobile/mytweak/theos/include/SpringBoard.h:33:19: error: field has incomplete type 'struct CGSize'
struct CGSize size;
^
/var/mobile/mytweak/theos/include/SpringBoard.h:33:12: note: forward declaration of 'CGSize'
struct CGSize size;
^
/var/mobile/mytweak/theos/include/SpringBoard.h:229:34: error: cannot find protocol declaration for 'NSObject'
#protocol APSConnectionDelegate <NSObject>
^
/var/mobile/mytweak/theos/include/SpringBoard.h:233:37: error: cannot find protocol declaration for 'NSObject'
#protocol AVExternalDeviceDelegate <NSObject>
^
/var/mobile/mytweak/theos/include/SpringBoard.h:236:27: error: cannot find protocol declaration for
'BBSectionIdentity'
#protocol BBDataProvider <BBSectionIdentity>
^
/var/mobile/mytweak/theos/include/SpringBoard.h:240:31: error: cannot find protocol declaration for 'NSObject'
#protocol BBObserverDelegate <NSObject>
^
/var/mobile/mytweak/theos/include/SpringBoard.h:246:30: error: cannot find protocol declaration for 'NSObject'
#protocol BBSectionIdentity <NSObject>
^
/var/mobile/mytweak/theos/include/SpringBoard.h:250:41: error: cannot find protocol declaration for 'NSObject'
#protocol BSSettingDescriptionProvider <NSObject>
^
/var/mobile/mytweak/theos/include/SpringBoard.h:255:34: error: cannot find protocol declaration for 'NSObject'
#protocol BSTransactionObserver <NSObject>
^
/var/mobile/mytweak/theos/include/SpringBoard.h:258:31: error: cannot find protocol declaration for 'NSObject'
#protocol BSWatchdogDelegate <NSObject>
^
/var/mobile/mytweak/theos/include/SpringBoard.h:261:38: error: cannot find protocol declaration for 'NSObject'
#protocol CLLocationManagerDelegate <NSObject>
^
/var/mobile/mytweak/theos/include/SpringBoard.h:264:41: error: cannot find protocol declaration for 'NSObject'
#protocol FBApplicationLibraryObserver <NSObject>
^
/var/mobile/mytweak/theos/include/SpringBoard.h:267:45: error: cannot find protocol declaration for 'NSObject'
#protocol FBApplicationPlaceholderObserver <NSObject>
^
/var/mobile/mytweak/theos/include/SpringBoard.h:270:41: error: cannot find protocol declaration for
'FBProcessObserver'
#protocol FBApplicationProcessObserver <FBProcessObserver>
^
/var/mobile/mytweak/theos/include/SpringBoard.h:276:37: error: cannot find protocol declaration for 'NSObject'
#protocol FBDisplayManagerObserver <NSObject>
^
/var/mobile/mytweak/theos/include/SpringBoard.h:279:37: error: cannot find protocol declaration for 'NSObject'
#protocol FBProcessManagerObserver <NSObject>
^
/var/mobile/mytweak/theos/include/SpringBoard.h:284:30: error: cannot find protocol declaration for 'NSObject'
#protocol FBProcessObserver <NSObject>
^
/var/mobile/mytweak/theos/include/SpringBoard.h:287:35: error: cannot find protocol declaration for 'NSObject'
#protocol FBSceneManagerDelegate <NSObject>
^
/var/mobile/mytweak/theos/include/SpringBoard.h:293:35: error: cannot find protocol declaration for 'NSObject'
#protocol FBSceneManagerObserver <NSObject>
^
/var/mobile/mytweak/theos/include/SpringBoard.h:302:46: error: cannot find protocol declaration for 'NSObject'
#protocol FBSynchronizedTransactionDelegate <NSObject>
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [obj/Tweak.xm.0ad6af3a.o] Error 1
make[1]: *** [internal-library-all_] Error 2
make: *** [mytweak.all.tweak.variables] Error 2
I really don't know where is the mistake, I really tried everything, also "make -i" but it doesn't create the dylib file!
Also using my dumped headers, for SpringBoard, I get:
iPhone-di-Gabriele:/var/mobile/test root# make package
/var/mobile/test/theos/makefiles/targets/Darwin-arm/iphone.mk:43: Targeting iOS 4.0 and higher is not supported with iphone-gcc. Forcing clang.
/var/mobile/test/theos/makefiles/targets/Darwin-arm/iphone.mk:53: Deploying to iOS 3.0 while building for 6.0 will generate armv7-only binaries.
Making all for tweak test...
Preprocessing Tweak.xm...
Compiling Tweak.xm...
In file included from Tweak.xm:1:
In file included from /var/mobile/test/theos/include/SpringBoard/SpringBoard.h:9:
In file included from /var/mobile/test/theos/include/SpringBoard/SBBannerContainerViewController.h:8:
In file included from /var/mobile/test/theos/include/SpringBoard/UIViewControllerAnimatedTransitioning.h:8:
In file included from /var/mobile/test/theos/include/SpringBoard/NSObject.h:8:
/var/mobile/test/theos/include/SpringBoard/SpringBoard-Structs.h:26:2: error:
unknown type name 'BOOL'
BOOL _field1;
^
/var/mobile/test/theos/include/SpringBoard/SpringBoard-Structs.h:27:2: error:
unknown type name 'BOOL'
BOOL _field2;
^
/var/mobile/test/theos/include/SpringBoard/SpringBoard-Structs.h:28:2: error:
unknown type name 'BOOL'
BOOL _field3;
^
/var/mobile/test/theos/include/SpringBoard/SpringBoard-Structs.h:29:2: error:
unknown type name 'BOOL'
BOOL _field4;
^
/var/mobile/test/theos/include/SpringBoard/SpringBoard-Structs.h:30:2: error:
unknown type name 'BOOL'
BOOL _field5;
^
/var/mobile/test/theos/include/SpringBoard/SpringBoard-Structs.h:66:2: error:
unknown type name 'BOOL'
BOOL itemIsEnabled[25];
^
/var/mobile/test/theos/include/SpringBoard/SpringBoard-Structs.h:67:2: error:
unknown type name 'BOOL'
BOOL timeString[64];
^
/var/mobile/test/theos/include/SpringBoard/SpringBoard-Structs.h:70:2: error:
unknown type name 'BOOL'
BOOL serviceString[100];
^
/var/mobile/test/theos/include/SpringBoard/SpringBoard-Structs.h:71:2: error:
unknown type name 'BOOL'
BOOL serviceCrossfadeString[100];
^
/var/mobile/test/theos/include/SpringBoard/SpringBoard-Structs.h:72:2: error:
unknown type name 'BOOL'
BOOL serviceImages[2][100];
^
/var/mobile/test/theos/include/SpringBoard/SpringBoard-Structs.h:73:2: error:
unknown type name 'BOOL'
BOOL operatorDirectory[1024];
^
/var/mobile/test/theos/include/SpringBoard/SpringBoard-Structs.h:80:2: error:
unknown type name 'BOOL'
BOOL batteryDetailString[150];
^
/var/mobile/test/theos/include/SpringBoard/SpringBoard-Structs.h:86:2: error:
unknown type name 'BOOL'
BOOL activityDisplayId[256];
^
/var/mobile/test/theos/include/SpringBoard/SpringBoard-Structs.h:102:2: error:
unknown type name 'BOOL'
BOOL _field3[4088];
^
/var/mobile/test/theos/include/SpringBoard/SpringBoard-Structs.h:116:2: error:
unknown type name 'BOOL'
BOOL __opaque[40];
^
/var/mobile/test/theos/include/SpringBoard/SpringBoard-Structs.h:162:2: error:
unknown type name 'BOOL'
BOOL valid;
^
/var/mobile/test/theos/include/SpringBoard/SpringBoard-Structs.h:179:2: error:
unknown type name 'BOOL'
BOOL isValid;
^
In file included from Tweak.xm:1:
In file included from /var/mobile/test/theos/include/SpringBoard/SpringBoard.h:9:
In file included from /var/mobile/test/theos/include/SpringBoard/SBBannerContainerViewController.h:8:
In file included from /var/mobile/test/theos/include/SpringBoard/UIViewControllerAnimatedTransitioning.h:8:
/var/mobile/test/theos/include/SpringBoard/NSObject.h:10:1: error: redefinition
of 'NSString' as different kind of symbol
#class NSString;
^
/var/mobile/test/theos/include/SpringBoard/SpringBoard-Structs.h:135:3: note:
previous definition is here
} NSString;
^
In file included from Tweak.xm:1:
In file included from /var/mobile/test/theos/include/SpringBoard/SpringBoard.h:9:
In file included from /var/mobile/test/theos/include/SpringBoard/SBBannerContainerViewController.h:8:
In file included from /var/mobile/test/theos/include/SpringBoard/UIViewControllerAnimatedTransitioning.h:8:
/var/mobile/test/theos/include/SpringBoard/NSObject.h:24:3: error: expected a
type
-(BOOL)respondsToSelector:(SEL)selector;
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [obj/Tweak.xm.56f06e0e.o] Error 1
make[1]: *** [internal-library-all_] Error 2
make: *** [test.all.tweak.variables] Error 2
Thank you to everyone who wants to help me.
If you get these errors, make sure you have not extracted, or copied SDK folder (iPhoneOSX.X.sdk) on Windows, because in this way you will lose every (symbolic) link between sdk's files. So manage and organize your sdk folder on Mac OS, iOS or Linux (but I didn't tried on this one).
Good Luck!

Building Python from source as a framework on Mac OS X Mountain Lion: error in headers

I was building Python (3.4 dev version) from source as a framework on OS X 10.8. I'm a relative newbie to Mac OS X internals and couldn't figure out why the OS X framework headers caused these errors. Can someone please give me some pointers?
I use the latest version of GNU gcc on my mac instead of the Apple supplied LLVM compiler. Perhaps, that's causing a compatibility problem.
gcc -Wno-unused-result -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -o FileSettings.o -c ./FileSettings.m
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:123:0,
from ./FileSettings.h:9,
from ./FileSettings.m:9:
/System/Library/Frameworks/Foundation.framework/Headers/NSTask.h:69:24: error: expected identifier or ‘(’ before ‘^’ token
#property (copy) void (^terminationHandler)(NSTask *) NS_AVAILABLE(10_7, NA);
^
/System/Library/Frameworks/Foundation.framework/Headers/NSTask.h:72:1: error: expected identifier before ‘end’
#end
^
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:159:0,
from ./FileSettings.h:9,
from ./FileSettings.m:9:
/System/Library/Frameworks/Foundation.framework/Headers/NSUserScriptTask.h:36:15: error: expected identifier or ‘(’ before ‘^’ token
typedef void (^NSUserScriptTaskCompletionHandler)(NSError *error);
^
/System/Library/Frameworks/Foundation.framework/Headers/NSUserScriptTask.h:37:1: error: unknown type name ‘NSUserScriptTaskCompletionHandler’
- (void)executeWithCompletionHandler:(NSUserScriptTaskCompletionHandler)handler;
^
/System/Library/Frameworks/Foundation.framework/Headers/NSUserScriptTask.h:53:15: error: expected identifier or ‘(’ before ‘^’ token
typedef void (^NSUserUnixTaskCompletionHandler)(NSError *error);
^
/System/Library/Frameworks/Foundation.framework/Headers/NSUserScriptTask.h:54:1: error: unknown type name ‘NSUserUnixTaskCompletionHandler’
- (void)executeWithArguments:(NSArray *)arguments completionHandler:(NSUserUnixTaskCompletionHandler)handler;
^
/System/Library/Frameworks/Foundation.framework/Headers/NSUserScriptTask.h:68:15: error: expected identifier or ‘(’ before ‘^’ token
typedef void (^NSUserAppleScriptTaskCompletionHandler)(NSAppleEventDescriptor *result, NSError *error);
^
/System/Library/Frameworks/Foundation.framework/Headers/NSUserScriptTask.h:69:1: error: unknown type name ‘NSUserAppleScriptTaskCompletionHandler’
- (void)executeWithAppleEvent:(NSAppleEventDescriptor *)event completionHandler:(NSUserAppleScriptTaskCompletionHandler)handler;
^
/System/Library/Frameworks/Foundation.framework/Headers/NSUserScriptTask.h:86:15: error: expected identifier or ‘(’ before ‘^’ token
typedef void (^NSUserAutomatorTaskCompletionHandler)(id result, NSError *error);
^
/System/Library/Frameworks/Foundation.framework/Headers/NSUserScriptTask.h:87:1: error: unknown type name ‘NSUserAutomatorTaskCompletionHandler’
- (void)executeWithInput:(id <NSSecureCoding>)input completionHandler:(NSUserAutomatorTaskCompletionHandler)handler;
^
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:160:0,
from ./FileSettings.h:9,
from ./FileSettings.m:9:
/System/Library/Frameworks/Foundation.framework/Headers/NSXPCConnection.h:46:11: error: expected identifier or ‘(’ before ‘^’ token
void (^_interruptionHandler)();
^
make[2]: *** [FileSettings.o] Error 1
make[1]: *** [install_PythonLauncher] Error 2
make: *** [frameworkinstallapps] Error 2
The errors correspond precisely to the 'block' extension Apple developed for C, C++ and Objective-C languages. GCC (the GNU version) doesn't recognize the block occurences and complains.

Resources