andreacremaschi / SpatialDBKit

An Objective-C lightweight spatial RDBMS (based on SQLite/SpatiaLite)
Other
73 stars 67 forks source link

EXC_BAD_ACCESS on spatialite_init(TRUE) #21

Open davidchiles opened 9 years ago

davidchiles commented 9 years ago

I made a completely new project to make sure.

Steps

platform :ios, '6.0'

target 'example' do

pod 'SpatialDBKit', '~> 0.1'

end

target 'exampleTests' do

end
#import "AppDelegate.h"
#import <SpatialDBKit/SpatialDatabase.h>

@interface AppDelegate ()

@end

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    NSString *filePath = [NSTemporaryDirectory() stringByAppendingPathComponent:@"db.sqlite"];
    SpatialDatabase *database = [[SpatialDatabase alloc] initWithPath:filePath];

    return YES;
}

Crash on line 114 of spatialite_init.c EXC_BAD_ACCESS

sqlite3_auto_extension ((void (*)(void)) init_spatialite_extension);
davidchiles commented 9 years ago

I pulled the latest changes into a fork and that seemed to fix the issue.

Maybe update the podspec?

andreacremaschi commented 9 years ago

ugh. I am not using myself this project since some time, so maybe something broken in the meanwhile. This seems to be the culprit: https://github.com/davidchiles/SpatialDBKit/commit/cffcdc8d73344d96f2ce4b1aeaad89109c7b5d02

I will integrate it ASAP, thank you for pointing it out!

zhangyuning1 commented 8 years ago

But it still does not work. You must use the file 'spatialDatabase.m' in the example project to replace the corresponding file in your project.Then you will see that it works!

Antlers777 commented 4 years ago

但是它仍然不起作用。 您必须在示例项目中使用文件'spatialDatabase.m'来替换项目中的相应文件,然后您会看到它起作用了!

Hi, I did as you said, but still reported this error, can you direct me? I use swift5 and xcode11.

Antlers777 commented 4 years ago

When I use the SpatialDBKit added by cocoapods, I first report an error of "cstddef" I can't find it. I will go to geo_ c.h . The program starts to crash when it runs. I want to get help. I use swift5 and Xcode 11