gpt4 book ai didi

ios - Xcode 8.3.3 for iOS 应用程序中体系结构 x86_64 的 undefined symbol

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:25:10 25 4
gpt4 key购买 nike

我刚刚使用 Swift for iOS 在 Xcode 8.3.3 中创建了一个新项目,并且我尝试导入外部库 SwiftLibModbus

我已移植该库以使用 Swift 3(也就是说,我修复了所有错误)。该库正在使用另一个名为 libmodbus 的库,该库是用 C 编写的,导入此库时出现 Undefined symbols for architecture x86_64 错误.

这是完整的错误:

Undefined symbols for architecture x86_64:
"_modbus_free", referenced from:
__TFC23SomeProject_Wi_Fi_Connect14SwiftLibModbusD in SwiftLibModbus.o
"_modbus_strerror", referenced from:
__TFC23SomeProject_Wi_Fi_Connect14SwiftLibModbusP33_56F751289226F31D555D5DEEC0F0514F12buildNSErrorfT5errnoVs5Int32_CSo7NSError in SwiftLibModbus.o
"_modbus_write_registers", referenced from:
__TFFC23SomeProject_Wi_Fi_Connect14SwiftLibModbus23writeRegistersFromAndOnFT7addressVs5Int3211numberArrayCSo7NSArray7successFT_T_7failureFCSo7NSErrorT__T_U_FT_T_ in SwiftLibModbus.o
"_modbus_read_input_registers", referenced from:
__TFFC23SomeProject_Wi_Fi_Connect14SwiftLibModbus22readInputRegistersFromFT12startAddressVs5Int325countS1_7successFGSaPs9AnyObject__T_7failureFCSo7NSErrorT__T_U_FT_T_ in SwiftLibModbus.o
"_modbus_write_register", referenced from:
__TFFC23SomeProject_Wi_Fi_Connect14SwiftLibModbus13writeRegisterFT7addressVs5Int325valueS1_7successFT_T_7failureFCSo7NSErrorT__T_U_FT_T_ in SwiftLibModbus.o
"_modbus_write_bit", referenced from:
__TFFC23SomeProject_Wi_Fi_Connect14SwiftLibModbus8writeBitFT7addressVs5Int326statusSb7successFT_T_7failureFCSo7NSErrorT__T_U_FT_T_ in SwiftLibModbus.o
"_modbus_new_tcp", referenced from:
__TFC23SomeProject_Wi_Fi_Connect14SwiftLibModbus8setupTCPfT9ipAddressCSo8NSString4portVs5Int326deviceS2__Sb in SwiftLibModbus.o
"_modbus_set_error_recovery", referenced from:
__TFC23SomeProject_Wi_Fi_Connect14SwiftLibModbus8setupTCPfT9ipAddressCSo8NSString4portVs5Int326deviceS2__Sb in SwiftLibModbus.o
"_modbus_close", referenced from:
__TFC23SomeProject_Wi_Fi_Connect14SwiftLibModbus10disconnectfT_T_ in SwiftLibModbus.o
"_modbus_connect", referenced from:
__TFC23SomeProject_Wi_Fi_Connect14SwiftLibModbus16connectWithErrorfCSo7NSErrorSb in SwiftLibModbus.o
__TFFC23SomeProject_Wi_Fi_Connect14SwiftLibModbus7connectFT7successFT_T_7failureFCSo7NSErrorT__T_U_FT_T_ in SwiftLibModbus.o
"_modbus_read_registers", referenced from:
__TFFC23SomeProject_Wi_Fi_Connect14SwiftLibModbus17readRegistersFromFT12startAddressVs5Int325countS1_7successFGSaPs9AnyObject__T_7failureFCSo7NSErrorT__T_U_FT_T_ in SwiftLibModbus.o
"_modbus_read_input_bits", referenced from:
__TFFC23SomeProject_Wi_Fi_Connect14SwiftLibModbus17readInputBitsFromFT12startAddressVs5Int325countS1_7successFGSaPs9AnyObject__T_7failureFCSo7NSErrorT__T_U_FT_T_ in SwiftLibModbus.o
"_modbus_read_bits", referenced from:
__TFFC23SomeProject_Wi_Fi_Connect14SwiftLibModbus12readBitsFromFT12startAddressVs5Int325countS1_7successFGSaPs9AnyObject__T_7failureFCSo7NSErrorT__T_U_FT_T_ in SwiftLibModbus.o
"_modbus_set_slave", referenced from:
__TFC23SomeProject_Wi_Fi_Connect14SwiftLibModbus8setupTCPfT9ipAddressCSo8NSString4portVs5Int326deviceS2__Sb in SwiftLibModbus.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

有什么办法解决这个问题吗?这实际上是我发现的唯一可用于 Modbus 的库。

谢谢 :)

最佳答案

嗯...您是否使用标记的“如果需要复制项目”和“创建文件夹引用”将文件拖到文件夹中?

如果是这样,Xcode 可能无法理解它需要为该文件夹中的正确架构编译文件。只需将一堆文件直接拖到 Xcode 中就可以了。

关于ios - Xcode 8.3.3 for iOS 应用程序中体系结构 x86_64 的 undefined symbol ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46096095/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com