我在我的iPad应用程序中使用了2个第三方库.我不知道这些库的源代码.这些库在两者中都具有相同名称的函数.因为功能名称中的冲突,我得到"Apple Mach - O(id)错误".我无法更改其中的函数名称,因为源代码未知.在构建应用程序时,错误正在发生.
该错误表明:
ld:/ Users/Desktop/untitled文件夹/ Universal/lib/simulator/myLib.a(mem.o)和/ Users/Library/Developer/Xcode/DerivedData/iOS-aqpprpcivvjjadbsutqqmtjsoczk/Build/Intermediates/ios中的重复符号_T_strcpy. build/Debug-iphonesimulator/myApp iPad.build/Objects-normal/i386/pdcrypte2.o for architecture i386 collect2:ld返回1退出状态命令/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-g++- 4.2退出代码1失败
谁能分享一些建议?
你能使用静态库中定义的宏吗?
我有自己的调试宏TWDEBUG,我在一个我创建用于共享的静态库中使用.如果我将静态库导入到我的新项目并使用它,编译器似乎无法识别它.我确实将预处理器宏设置为TWDEBUGand Other C flags和Other C++ flagsto -TWDEBUG,但是当我运行代码时,ifdef宏不会被执行.
我正在尝试显示所有可用的BLE信标.我有一些Estimote和Kontakt.io信标,由于某种原因,下面的BLE扫描代码找不到任何一个.
我经历了与BLE发现有关的所有可能的SO问题,并且代码与其他地方完全一样.
- (void)viewDidLoad {
[super viewDidLoad];
self.manager = [[CBCentralManager alloc] initWithDelegate:self queue:nil];
}
/*
Request CBCentralManager to scan for all available services
*/
- (void) startScan
{
NSLog(@"Start scanning");
NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], CBCentralManagerScanOptionAllowDuplicatesKey, nil];
[self.manager scanForPeripheralsWithServices:nil options:options];
}
Run Code Online (Sandbox Code Playgroud)
永远不会调用此委托方法
/*
Invoked when the central discovers bt peripheral while scanning.
*/
- (void) centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)aPeripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI
{
NSLog(@"THIS NEVER GETS CALLED");
}
Run Code Online (Sandbox Code Playgroud) 当我简单地传递int时,我收到警告:
警告:不兼容的整数到指针转换将int传递给int类型的参数
换句话说是什么 int *