3

我正在编写一个 appcelerator 模块来使用我自己的 sqlite3 构建。我面临的问题是默认系统sqlite代码似乎无论如何都被链接了。

我已经尝试了很多事情,但我会认为将所有 sqlite 代码放在我的 .m 文件中会导致该代码被调用。

MySqlite.m

#import "sqlite3.h"
#import "sqlite3.c"

#pragma Public APIs
-(NSString *)getSqliteVersion:(id)args
{    
    return [NSString stringWithFormat:@"%s", sqlite3_libversion()];
}

getSqliteVersion 成员仍然返回 iOS 标准 sqlite 库的版本号

那么有谁知道如何更改链接器以获取我自己的 sqlite 代码,或者有没有办法将 sqlite “包装”在命名空间等中?

编辑 10/10/12:对不起,更多相关信息。构建过程分为两个步骤。

我正在做的部分是构建模块,它是一个打包的静态库,即一个 .a 文件

这个 .a 文件分发给其他用户,然后他们使用这个模块构建他们的应用程序。这就是为什么我无法控制第二个链接步骤并删除任何 .dylib sqlite 引用的原因。

一些我认为我需要将我的 sqlite lib 放入私有“命名空间”的方式。我在概念上使用命名空间,我知道 C 没有它们

不确定它是否有帮助,但模块构建的 Ti 构建命令似乎是:

从命令行构建设置:

SDKROOT = iphonesimulator5.0

=== 使用配置版本构建本机目标 tisqlite_crypt_ios 项目 tisqlite_crypt_ios ===

检查依赖项

CompileC build/tisqlite_crypt_ios.build/Release-iphonesimulator/tisqlite_crypt_ios.build/Objects-normal/i386/UkCoClinicalsoftwaresolutionsTisqlite_crypt_iosModule.o Classes/UkCoClinicalsoftwaresolutionsTisqlite_crypt_iosModule.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
    cd /TitaniumStudioWorkspace/tisqlite_crypt_ios
    setenv LANG en_US.US-ASCII
    setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin:/usr/local/git/bin"
    /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang -x objective-c -arch i386 -fmessage-length=0 -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -std=c99 -Wno-trigraphs -fpascal-strings -Os -Wno-return-type -Wno-parentheses -Wswitch -Wunused-function -Wno-unused-parameter -Wno-unused-variable -Wno-unused-value -Wno-shorten-64-to-32 -DTI_VERSION= -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -fexceptions -fasm-blocks -mmacosx-version-min=10.6 -gdwarf-2 -Wno-sign-conversion -fobjc-abi-version=2 -fobjc-legacy-dispatch "-DIBOutlet=__attribute__((iboutlet))" "-DIBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName)))" "-DIBAction=void)__attribute__((ibaction)" -D__IPHONE_OS_VERSION_MIN_REQUIRED=40000 -iquote /TitaniumStudioWorkspace/tisqlite_crypt_ios/build/tisqlite_crypt_ios.build/Release-iphonesimulator/tisqlite_crypt_ios.build/UkCoClinicalsoftwaresolutionsTisqlite_crypt_ios-generated-files.hmap -I/TitaniumStudioWorkspace/tisqlite_crypt_ios/build/tisqlite_crypt_ios.build/Release-iphonesimulator/tisqlite_crypt_ios.build/UkCoClinicalsoftwaresolutionsTisqlite_crypt_ios-own-target-headers.hmap -I/TitaniumStudioWorkspace/tisqlite_crypt_ios/build/tisqlite_crypt_ios.build/Release-iphonesimulator/tisqlite_crypt_ios.build/UkCoClinicalsoftwaresolutionsTisqlite_crypt_ios-all-target-headers.hmap -iquote /TitaniumStudioWorkspace/tisqlite_crypt_ios/build/tisqlite_crypt_ios.build/Release-iphonesimulator/tisqlite_crypt_ios.build/UkCoClinicalsoftwaresolutionsTisqlite_crypt_ios-project-headers.hmap -I/TitaniumStudioWorkspace/tisqlite_crypt_ios/build/Release-iphonesimulator/include "-I/Library/Application Support/Titanium/mobilesdk/osx/2.1.3.GA/iphone/include" "-I/Library/Application Support/Titanium/mobilesdk/osx/2.1.3.GA/iphone/include/TiCore" -I/TitaniumStudioWorkspace/tisqlite_crypt_ios/build/tisqlite_crypt_ios.build/Release-iphonesimulator/tisqlite_crypt_ios.build/DerivedSources/i386 -I/TitaniumStudioWorkspace/tisqlite_crypt_ios/build/tisqlite_crypt_ios.build/Release-iphonesimulator/tisqlite_crypt_ios.build/DerivedSources -F/TitaniumStudioWorkspace/tisqlite_crypt_ios/build/Release-iphonesimulator -DTI_POST_1_2 -include /var/folders/LP/LPsQmql2FfCGO9YCrCUKUU+++TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/UkCoClinicalsoftwaresolutionsTisqlite_crypt_ios_Prefix-hbaweqhgijjnfpfynapljpziqmjk/UkCoClinicalsoftwaresolutionsTisqlite_crypt_ios_Prefix.pch -MMD -MT dependencies -MF /TitaniumStudioWorkspace/tisqlite_crypt_ios/build/tisqlite_crypt_ios.build/Release-iphonesimulator/tisqlite_crypt_ios.build/Objects-normal/i386/UkCoClinicalsoftwaresolutionsTisqlite_crypt_iosModule.d -c /TitaniumStudioWorkspace/tisqlite_crypt_ios/Classes/UkCoClinicalsoftwaresolutionsTisqlite_crypt_iosModule.m -o /TitaniumStudioWorkspace/tisqlite_crypt_ios/build/tisqlite_crypt_ios.build/Release-iphonesimulator/tisqlite_crypt_ios.build/Objects-normal/i386/UkCoClinicalsoftwaresolutionsTisqlite_crypt_iosModule.o

In file included from /TitaniumStudioWorkspace/tisqlite_crypt_ios/Classes/UkCoClinicalsoftwaresolutionsTisqlite_crypt_iosModule.m:14:
/TitaniumStudioWorkspace/tisqlite_crypt_ios/Classes/sqlite3.c:27620:32:{27620:32-27620:45}{27620:30-27620:31}: warning: implicit conversion from 'long long' to 'long' changes value from 9223372036854775807 to -1 [-Wconstant-conversion,3]
     mask = (sizeof(long)==8) ? LARGEST_INT64 : 0x7fffffff;
                              ~ ^~~~~~~~~~~~~
/TitaniumStudioWorkspace/tisqlite_crypt_ios/Classes/sqlite3.c:7946:25: note: instantiated from:
 #define LARGEST_INT64  (0xffffffff|(((i64)0x7fffffff)<<32))
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.

Libtool build/Release-iphonesimulator/libUkCoClinicalsoftwaresolutionsTisqlite_crypt_ios.a normal i386
    cd /TitaniumStudioWorkspace/tisqlite_crypt_ios
    setenv MACOSX_DEPLOYMENT_TARGET 10.6
    setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin:/usr/local/git/bin"
    /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/libtool -static -arch_only i386 -syslibroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -L/TitaniumStudioWorkspace/tisqlite_crypt_ios/build/Release-iphonesimulator -filelist /TitaniumStudioWorkspace/tisqlite_crypt_ios/build/tisqlite_crypt_ios.build/Release-iphonesimulator/tisqlite_crypt_ios.build/Objects-normal/i386/UkCoClinicalsoftwaresolutionsTisqlite_crypt_ios.LinkFileList -ObjC -framework Foundation -o /TitaniumStudioWorkspace/tisqlite_crypt_ios/build/Release-iphonesimulator/libUkCoClinicalsoftwaresolutionsTisqlite_crypt_ios.a


** BUILD SUCCEEDED **
4

0 回答 0