Error: Objective C: GLES2 File not Found - ios

In the code bellow it says that there is an error and that 'GLES2/gl2ext.h' File not Found. Does anyone know were to add the file or what the file is. Thanks
Code with error:
#include <GLES2/gl2ext.h>

After upgrading to Xcode 6, I had to make the following change to one my projects:
#import <OpenGLES/ES2/glext.h>

Related

Use of undeclared type 'PKCS7' (Receipt-Validation/OpenSSL)

To set up Receipt-Validation in my iOS app, I am now following this tutorial:
https://www.raywenderlich.com/9257-in-app-purchases-receipt-validation-tutorial
and reading at this point: Loading the Receipt.
While reading and attempting to understand what is going on I also try to integrate the code in my own app, by doing so getting a hands-on understanding of the process.
Here is one problem I am hitting at this moment:
On this line of code:
private func loadReceipt() -> UnsafeMutablePointer<PKCS7>? {
I get this error message:
Use of undeclared type 'PKCS7'
After searching the net and trying a few things, I guess it is related to the use of the use of the ReceiptVerifier-Bridging-Header.h file. But I am not sure how to set it in the project.
I will be glad if anyone has some tip allowing me to move forward.
Thanks in advance!
In case this can be useful, here is the meaningful contents of the bridging header file (ReceiptVerifier-Bridging-Header.h):
#import <openssl/pkcs7.h>
#import <openssl/objects.h>
#import <openssl/evp.h>
#import <openssl/ssl.h>
#import <openssl/asn1_locl.h>
The problem is that I had simply copied the bridge-header file, without doing the proper setting as explained here:
https://developer.apple.com/documentation/swift/imported_c_and_objective-c_apis/importing_objective-c_into_swift

objective-c use cocoapods add Swift framework not found file

I'm working on an objective-c project. I added a swift framework, which gave me errors.
When I touch "command" can find the file. When I use #import also can add "ChartLineView.swift".
But when I implement it as,
ChartLineView *cl = ....
I get an error, " Use of undeclared identifier LineChartView"
What could be wrong?
I guess your are having issue in importing swift library(added via cocoapods) in your Objective C project. Just go in your .m file and import the swift library like this.
#import LineChartView; // i suppose LineChartView is the swift library name.

'PushmoteSDK/Headers/Pushmote.h' file not found when trying to use pushmote sdk

I am trying to follow the steps given here:
http://docs.pushmote.com/docs/import-pushmote-ios-sdk-swift
but I am getting this error: 'PushmoteSDK/Headers/Pushmote.h' file not found, when I try and build my app.
Its my Pushmote-Bridging-Header.h file that has this import statement and the file is clearly there, in project_dir/PushmoteSDK.framework/Headers/Pushmote.h
I have read about a few other header file not found error with xcode and the solutions seem to vary a lot, so I think it might have to do with the specific version of xcode. Perhaps someone has used pushmote with xcode7 before and can assist?
EDIT:
This is my Pushmote-Bridging-Header.h file found in /Users/alex/ios_projects/Monkey/Monkey/Pushmote-Bridging-Header.h
#ifndef Pushmote_Bridging_Header_h
#define Pushmote_Bridging_Header_h
#import "PushmoteSDK/Pushmote.h"
#endif /* Pushmote_Bridging_Header_h */
You should change import line like this;
#import "PushmoteSDK/Headers/Pushmote.h"
to
#import "PushmoteSDK/Pushmote.h"

'string' file not found in xcode 6

I have an xcode 6 swift project and I am trying to use C++ with it. In my project on the left I clicked 'new file' and I chose empty C++ file. Then I click yes and xcode generated Bridging-Header.h file.
In my new .cpp file I have #include <string>. I tried to compile the file and everything compiled fine. Later I realized that I forgot to include the .cpp file in the bridging-header.h because my swift files didn't have access to a function in my .cpp file. When I added the #import "cplusplusfile.cpp" in the bridging-header file, I get this error on this line:
#include <string> (!)'String' file not found
my goal is to get a string the user enters in a UITextField and send that string from my Swift files to a function in my C++ file so then I can use C++ to write that string to a file (I don't know how to read/write files in swift and couldn't find much on it..).
Would anyone know possible solutions? I looked online and other questions. One of the solutions was to change my cplusplusfile.cpp to cplusplusfile.mm. Unfortunately it didn't help :(
I'll answer something completely different cause I know you're going in the wrong direction, using C++ just to write a string to file is running around in circles, you want to use NSString and write that string directly to a file, in swift you can use the method
func writeToFile(_ path: String,
atomically useAuxiliaryFile: Bool,
encoding enc: UInt,
error error: NSErrorPointer) -> Bool
And give it a string which is the filename and the string to write get that by reading it directly from your UITextField by using myTextField.text, it should write that to file right away.
Good luck learning swift ! :)
also here's the class reference for NSString
Use following instead:
#import <string.h>

Not able to compile Ziparchive library (iOS)

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.

Resources