Closed Graphicooooone closed 5 years ago
@RingoD thx
As the tutorial said, you should add -objc_load
or -all_load
to add the extern variable for static lib.
But I installed WCDB through Cocoapods, and there already exists "-all_load" and "-objc" in the project.
Cocoapods automatically added "-objc" for me and I manually added "-all_load" still have the same problem.
Maybe you should provide a project that can reproduce this problem or try to upgrade to v1.0.6
Ok, after receiving the reply of issue, I tried cocoapod again and updated it to v1.0.6, but the same problem still exists. This is the demo I pulled from the project model, and when I run it, I get the same error message. [WCDB_FTS.zip](https://github.com/Tencent/wcdb/files/2288952/WCDB_FTS.zip)
@RingoD thanks
Thanks for your attention.
I think it's kind of bug in static lib and WCDB.
The order of file initialization can not be sure. BUT the ORM and external variable are related to it.
It's already fixed in next version.
Currently, you can use dynamic framework instead. e.g. Carthage
It's fixed by dynamic framework of v1.0.7
@RingoD I am using version v.1.0.7.5 of WCDB and the problem has not been solved
What does your podfile look like? And what's the console output of pod install
?
podfile:
platform :ios, '9.0' inhibit_all_warnings!
target 'Memento' do
...
pod 'WCDB'
...
end
... Installing WCDB (1.0.7.5) ...
Generating Pods project Integrating client project
[!] Please close any current Xcode sessions and use Memento.xcworkspace
for this project from now on.
Sending stats
Pod installation complete! There are 19 dependencies from the Podfile and 22 total pods installed.
@RingoD This is information about my podfile and the command line after executing 'pod install' I'm sorry for not replying to you in time thanks.
Did you add -ObjC
in your linker flag?
I've already added
Then I think it should be the construct order problem of static lib. There are three ways to fix.
WCTTokenizerNameWCDB
. The value of WCTTokenizerNameWCDB
should be @"WCDB"
;use_frameworks!
into your podfile to port WCDB to dynamic framework;You can choose one of them for your favor.
I think I will use the first method to solve the problem for the time being, but there is a problem if there are multiple FTS files in the project, is it allowed to use the same "WCDB" as WCTTokenizerNameWCDB
source code NSString *const WCTTokenizerNameWCDB = @(WCDB::FTS::WCTModule::Name);
Yes, there will not be any problem.
It's fixed by redesigning the ORM feature to avoid global constructor. It will be released in next version.
It's fixed by redesigning the ORM feature to avoid global constructor. It will be released in next version.
1.Use raw string instead WCTTokenizerNameWCDB. The value of WCTTokenizerNameWCDB should be @"WCDB"; make bug: [WCDB][ERROR]Code:2, Type:Abort, Msg:Tokenize name is not registered
I think I will use the first method to solve the problem for the time being, but there is a problem if there are multiple FTS files in the project, is it allowed to use the same "WCDB" as WCTTokenizerNameWCDB
The first method make that :[WCDB][ERROR]Code:2, Type:Abort, Msg:Tokenize name is not registered
The language of WCDB
Objective-C
The version of WCDB
v1.0.5
The platform of WCDB
iOS
The installation of WCDB
Cocoapods
What's the issue?
There are many TFS Class similar to WCTSampleFTSData in my project. I tried to do the same thing with demo, but the project crashed at startup. The information is as follows. Could it be that WCTTokenizerNameWCDB is nil causing?