我想從object-c程序中,調用svn的api,實現(xiàn)版本控制的功能。
我先在mac上費了好大力氣,成功編譯了subversion的源碼。然后在xcode的build-settings里面的header path中加入了svn api的頭文件路徑。又在build-phases中將libsvn_client_1.a引入到了libraries里面。但編譯的時候報錯,代碼如下:
頭部引入
#import "svn_client.h"
- (void)tableViewSelectionDidChange:(NSNotification *)notification
{
NSLog(@"select one row!");
char* url = "http://***.***.com/svn/***/unity/****";
//list_repo2(url);
//listRepo(url);
// 測試下
svn_checksum_size(nil);
}
報錯的信息如下 :
Undefined symbols for architecture x86_64:
"_svn_checksum_size", referenced from:
-[ViewController tableViewSelectionDidChange:] in ViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
拜托大家?guī)兔纯础?/p>
認證高級PHP講師
Your static library does not support compilationx86_64
對應的二進制。如果自己編譯的話,需要增加對x86_64
. It doesn’t matter if it doesn’t support it. It just won’t run on the simulator and can only be run on a real machine.
In addition, when running on a real machine, an error will be reported if it is not supported amr64
.
Set the compilation options, which are required if all CPUs are supported so far (the last two are used to support the simulator): armv7
armv7s
arm64
x86
x86_64
.