In my first experience with CocoaPods I've run into a problem. I'm using CocoaPods on an existing project to install DTCoreText specifically for DTAttributedLabel. All goes smoothly and appears to work fine but the second I include DTCoreText.h I get multiple errors with the CoreText framework like the following:
CoreText.framework/Headers/CTRunDelegate.h:130:16: Expected member name or ';' after declaration specifiers
typedef struct
{
CFIndex version;
CTRunDelegateDeallocateCallback dealloc;
CTRunDelegateGetAscentCallback getAscent;
CTRunDelegateGetDescentCallback getDescent;
CTRunDelegateGetWidthCallback getWidth;
} CTRunDelegateCallbacks;
CoreText.framework/Headers/SFNTLayoutTypes.h:821:23: Expected member name or ';' after declaration specifiers
struct LcarCaretTable {
Fixed version;
UInt16 format;
SFNTLookupTable lookup;
};
I created a single view project just to check my install technique and was able to use DTCoreText just fine.
Is there a setting that I'm missing that could be causing this? (Deployment target: 6.1, SDK 6.1)
Perhaps a conflict with an existing library?
I resolved this issue by creating a new project and installing all dependencies through Cocoapods. It appears the issue was related to a conflict.
Related
I have the following problem.....
Error: Variables must be declared using the keywords 'const', 'final', 'var' or a type name.
Try adding the name of the type of the variable or the keyword 'var'.
int _counter = 0;dsggfsgfh;
^^^^^^^^^
Target kernel_snapshot failed: Exception
FAILURE: Build failed with an exception.
I'm a beginner with Flutter. How can I solve this problem?
Your code has junk words or sentences, check your line ended with dsggfsgfh; which might be added unfortunately. Just remove it this will work.
It's possible that it's a compatibility issue between flutter framework and engine. You can try and:
Upgrade flutter to the latest version
Create a new project
Copy the code from the old project in steps
If you have plugins from the old project, add them one by one as you run the emulator
(It's possible that a certain version of a plugin has a compatibility issue with flutter)
I'm new in Swift. I want to create iOS app that can connect to PostgreSQL database. First I found library https://github.com/vapor/postgresql.git that should be added to my project via Swift Package Manager. Using tutorial I added required library to my project successfully (File -> Swift Packages -> Add Package Dependency):
list of added packages from SPM
But when I try to import this module into my view controller, Xcode shows error that module is not found:
not found
I tried several times to rebuild my project, created new project just for testing this issue. Also I found information about build phases and added this lib as a dependency:
build phases
But I still get error: "No such module PostgreSQL".
Can anyone help me?
I found solution by myself. I compiled C static library "libpq" (can be found in PostgreSQL sources) and added it to my swift project. Included this library by adding special bridging header file. Finally I got what I wanted.
P.S. If someone what to repeat, he or she should know: static C library must be compiled for iOS device architecture (and also in iOS simulator architecture which differs from iOS device arch.).
i use CCurl (https://github.com/IBM-Swift/CCurl.git) in my project (Kitura https://github.com/IBM-Swift/Kitura) then i call func curlHelperSetOptString , compile "swift build" and get an error:
duplicate symbol _curlHelperSetOptString in:
/Users/xxxx/Documents/server/ServerSwift/.build/debug/ServerSwift.build/UploadService.swift.o /Users/xxxx/Documents/server/ServerSwift/.build/debug/KituraNet.build/ClientRequest.swift.o
ld: 1 duplicate symbol for architecture x86_64 :0: error:
link command failed with exit code 1 (use -v to see invocation)
:0: error: build had 1 command failures
code:
import CCurl
var handle=curl_easy_init()
if (handle != nil) {
let url = "http: //example.com/"
let buffer=url.cString(using: .utf8)
curlHelperSetOptString(handle, CURLOPT_URL, buffer)
}
Help me ,plz
Actually it may be because we have defined the CCurl helper functions as extern inline, rather than as static inline. Apparently extern inline causes one of the references to the defined function to become an external name, which can cause problems if it is imported more than once.
We'll look into this.
IBM-Swift/CCurl.git 0.2.2 has been tagged. It contains a fix for the problem mentioned here.
You're probably including CCurl directly in your Package.swift when it's already included in Kitura-Net/Package.swift.
With most Swift modules, this wouldn't be a problem, but CCurl has to have a hack in it because libCurl contains mostly variadic functions and Swift doesn't import variadic functions from C libraries. The hack creates static functions in the C header file to create non-variadic version of the libCurl functions. It's those static functions that are being duplicated here (and each module is compiled separately, so you can't #ifndef around them because they can't see each other).
Try removing the CCurl dependency from your Package.swift file and just depend on the fact that it's being included for you, and hopefully you'll be okay.
Check that you don't have multiple entries under Build Phases/Compile Sources. If yes, remove them.
Also you could try cleaning your project or even run swift package generate-xcodeproj again.
It's because you are importing ccurl which is already imported in the kitura-net package.
I'm trying to build a command-line tool which uses sqlite. I have downloaded Stephen Celis' swift wrapper, SQLite.swift, and built a working OS X app. However, I am not able to build my command-line tool. I believe that I correctly followed the instructions to do so in the SQLite.swift Documentation for frameworkless targets, but apparently I am missing something. I get an error in Helper.swift # import CSQLite -> No such module 'CSQLite'.
I am linking against libsqlite3.dylib (also tried libsqlite3.tbd)
I added the SQLite.swift source to my project
I added #import sqlite3.h & #import "SQLite-Bridging.h" to my bridging header file. Perhaps of note, when I right-click on sqlite3.h or SQLite-Bridging.h, xCode does not know where/what they are.
I'm happy to send my test project (about 80KB, compressed) to anyone who can and is willing to help. There is probably a very simple solution, I just do not see what it is.
thx for any help,
-Craig
I've faced the same problem.
There were lots of compiler errors like "Connection.swift:26:8: Could not build Objective-C module 'CSQLite'"
The error has roots to the "lctx.h:13:25: Use of undeclared identifier 'SYS_getlcid'"
It worth mentioning that I have two Xcodes installed - v 6.2 at /Applications and v 7.3 at ~/Applications. My project is iOS app on Swift with SQLite pod and I open it with the Xcode 7.3.
The SQLite pod has a file at project_folder/Pods/SQLite.swift/CocoaPods/iphonesimulator/module.modulemap.
The file had the content
module CSQLite [system] {
header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/sqlite3.h"
export *
}
To fix compiler errors I changed the content of module.modulemap to
module CSQLite [system] {
header "/Users/my_user_name/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/sqlite3.h"
export *
}
The change is that I pointed search of sqlite3.h into my ~/Applications folder where Xcode 7.3 is located.
This made my project compiling.
I'm getting a few errors just after I updated my working copy via SVN.
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSCharacterSet.h:8:0 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSCharacterSet.h:8:32: error: Foundation/NSString.h: No such file or directory
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSCharacterSet.h:45:0 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSCharacterSet.h:45: error: expected ')' before 'unichar'
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSPathUtilities.h:10:0 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSPathUtilities.h:10: error: cannot find interface declaration for 'NSString'
All that errors tell that compiler is unable to find NSString.h file in Foundation framework and I have opened the Foundation framework in Xcode/Frameworks/Foundation.framework/Headers and noticed that there is no NSString header file there. Could anyone tell me what happened? I tried to delete the framework and add it again but it failed to. Still I don't have NSString header file.
try installing XCode again. Older SDK versions are no longer supported. Choose SDK 4.2 instead and compile it again. (I have copied the SDK 4.0 for backward compatibility but it is not shown in targets and project settings)
I had this problem in a project started in XCode 3 and now compiled in XCode 4, where the line
-#include <Foundation/NSString.h>
was flagged as no such file. I fixed it by re-adding the framework - although it was already appearing in my project (from when I had added it in XCode 3) using this approach:
How to "add existing frameworks" in Xcode 4?
I noticed the list seen by using this method did not include the Foundation framework.