I have a .m and .h file that generated with Thrift for objective-c based on this link :
http://wiki.apache.org/thrift/ThriftUsageObjectiveC
but there are a lot of error in .m files like :
1. error: duplicate interface definition for class
2. reimplementation of class 'bitlit_thrift_detect_cover_args'
3. use of undeclared identifier '__claim_id'; did you mean 'claim_id'?
4. use of undeclared identifier '__claim_id_isset'
5. reference to local variable 'claim_id' declared in enclosing context
6. error: use of undeclared identifier '__claim_id_isset'
__claim_id_isset = YES;
.....
7. fatal error: too many errors emitted, stopping now [-ferror-limit=]
would you please give me some hints, what is the problem?, is the error related to the xcode setting? my xCode Version is Version 4.6.1
Thanks in advance!
Here is the errors Picture:
Related
when I want use swift file in objective c project and I declare an object from swift class, I get "Use of undeclared identifier" error.
the way that I pass:
coping swift file in project and type #objc before declare swift class
create header file in project manually
set "Defines module" in target to Yes
set objective-C bridging header in target to $(SRCROOT)/$(PRODUCT_MODULE_NAME)-Bridging-Header.h
declare #import "productModuleName-Bridging-Header.h" in objective-c file
use name_of_swift_class *s = [[name_of_swift_class alloc] init];
when I want use swift file in step 6 I get "Use of undeclared identifier" error. why?!!! do I have the mistake?
when I test this steps in new project I don't get error but in project that I want it return error.
thank you for your help
The problem is at Step 5 You should not be importing "productModuleName-Bridging-Header.h" instead you should be importing "productModuleName-Swift.h"
P.S- After making this change clean your project, clear your derived data and build it. It will work. Hope it helps :)
Xcode gives me this weird error: Use of undeclared identifier 'vabs_s8'
File path: /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.0.sdk/usr/include/simd/common.h
This file is included by GameKit framework:
GameKit.h => simd.h => vector.h => common.h
Any suggestions how to fix this?
This error is to do with the architecture your targeting. A simple workaround is to place these at the top of common.h file.
#undef arm64
#undef arm
As you've noticed,gamekit includes simd/common.h in which ‘vabs_s8()’ function is undeclared.
Naturally, simd/common.h includes simd/base.h -> and -> simd/base.h includes arm_neon.h if ARM_NEON is defined. In arm_neon.h we have the declaration of ‘vabs_s8()’ function.
So if vabs_s8 is undeclared means the header is not included which means __ARM_NEON__ is not defined.
__ARM_NEON__ is enabled by default if you target armv7/arm64, so this means there might be something wrong with your project settings.
Solution: One of our programmers found out that adding "-mfpu=neon" in Other C Flags fixes this issue.
I am using 3rd party external framework in my objective-c project. I created an swift file in this project to use the framework.
In MyModule-Bridging-Header.h I have import external framework header
#import “ext-service/ext-service.h”
In the ext-service.h there is an constant:
typedef NS_ENUM(NSInteger, service_err_t) {
SERVICE_SUCCESS = 1
}
In my swift code
//Compiler error: use of unresolved identifier ‘SERVICE_SUCCESS’
if result == SERVICE_SUCCESS{
NSLog(“successful!”)
}
But I get compiler error:
use of unresolved identifier ‘SERVICE_SUCCESS’
Why?
The reason to the error you mentioned is SERVICE_SUCESS is unavailable(unknown).
There are 2 possible solutions:
Use service_err_t.SERVICE_SUCCESS instead of SERVICE_SUCESS
result is of type service_err_t then just using .SERVICE_SUCESS
Hope this helps!
I have a Problem when I try to compiling my iOS project with iOS 8.
The errors messages are:
Implicit declaration of function 'glReadPixels' is invalid in C99 compiling
Conflicting types for 'glReadPixels'
Declaration of 'glReadPixels' must be imported from module 'OpenGLES.ES3.gl' before it is required
Recently I have faced the same issue.
The easiest way to resolve this problem is by adding #import OpenGLES; line in each file where you have got this message.
For iOS 8 is necessary Import
#import <OpenGLES/ES3/glext.h>
This link is the solution Click Here...
I need to download and unzip a file in my Xcode project,
I am using Ziparchive (https://code.google.com/p/ziparchive/downloads/detail?name=ZipArchive.zip) to do so,instead of following every step I am getting compilation error as below:
/Developer/AR/vuforia-sdk-ios-2-6-8/samples/ARDemo/minizip/ioapi.c:68:18: Redefinition of 'fopen_file_func' as different kind of symbol
/Developer/AR/vuforia-sdk-ios-2-6-8/samples/ARDemo/minizip/ioapi.c:68:35: Use of undeclared identifier 'opaque'
/Developer/AR/vuforia-sdk-ios-2-6-8/samples/ARDemo/minizip/ioapi.c:68:58: Expected ';' after top level declarator
/Developer/AR/vuforia-sdk-ios-2-6-8/samples/ARDemo/minizip/ioapi.c:72:1: Expected unqualified-id
/Developer/AR/vuforia-sdk-ios-2-6-8/samples/ARDemo/minizip/ioapi.c:90:17: Redefinition of 'fread_file_func' as different kind of symbol
Developer/AR/vuforia-sdk-ios-2-6-8/samples/ARDemo/minizip/ioapi.c:90:42: Use of undeclared identifier 'stream'; did you mean 'strcat'?
Developer/AR/vuforia-sdk-ios-2-6-8/samples/ARDemo/minizip/ioapi.c:90:50: Use of undeclared identifier 'buf'
/Developer/AR/vuforia-sdk-ios-2-6-8/samples/ARDemo/minizip/ioapi.c:95:1: Expected unqualified-id
I dont have a clue how to compile it successfully, any help is appreciated.
In my case, it happens because I have an incorrect Prefix file.
It was including objective c imports outside the "#ifdef OBJC" block
So that there was no problem when all classes were objetctive-C classes but it didn't compile when I add the C classes of minizip.
Just moving all the imports in the prefix file inside the obj block and voilà!
#ifdef __OBJC__
#import <Availability.h>
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#endif
I hope this helps
Please Add the FrameWork libz.dylib in your project and solve your problem
Project setting -> Target-> Build Phases -> Linked Frameworks and Libraries -> select ibz.dylib
I got the solution,I am using Metaio SDK for Augmented Reality which has a compile dependancy, it can only be compiled as "Compile sources as - > Objective C++" and this was the reason creating the problem, Ziparchive compiled fine otherwise, now to merge both in the same project I made Ziparchive as a STATIC LIBRARY and linked it in Xcode, it solved the problem.