Testing on linux gives me error: undefined reference to "mangled" but builds fine

Hello,
I'm desperately trying to revive this project (this my fork updated) based on Pure Swift Libraries stack.
This project is quite old and I've make forks of authors libraries to update it and make it compile on Ubuntu.
After I've fixed some issues, mainly due to misalignment between swift version and libraries version, I've found myself stuck with those kind of errors during the linking phase after swift test.
Project itself seems to build fine, but as soon as I try to test it swift test it shows me that error.

andrea@ubuntu:~/Desktop/Punch/SwiftLinuxBLE$ swift test
error: link command failed with exit code 1 (use -v to see invocation)
<compiler-generated>:0: error: undefined reference to '$s13BluetoothGATT26GATTCharacteristicPropertyON'
<compiler-generated>:0: error: undefined reference to '$s13BluetoothGATT26GATTCharacteristicPropertyO0A013BitMaskOptionAAMc'
<compiler-generated>:0: error: undefined reference to '$s13BluetoothGATT26GATTCharacteristicPropertyON'
<compiler-generated>:0: error: undefined reference to '$s13BluetoothGATT22ATTAttributePermissionON'
<compiler-generated>:0: error: undefined reference to '$s13BluetoothGATT22ATTAttributePermissionO0A013BitMaskOptionAAMc'
<compiler-generated>:0: error: undefined reference to '$s13BluetoothGATT22ATTAttributePermissionON'
/home/andrea/Desktop/Punch/SwiftLinuxBLE/Sources/SwiftLinuxBLE/Characteristic.swift:38: error: undefined reference to '$s13BluetoothGATT26GATTCharacteristicPropertyON'
/home/andrea/Desktop/Punch/SwiftLinuxBLE/Sources/SwiftLinuxBLE/Characteristic.swift:23: error: undefined reference to '$s13BluetoothGATT26GATTCharacteristicPropertyON'
/home/andrea/Desktop/Punch/SwiftLinuxBLE/Sources/SwiftLinuxBLE/Characteristic.swift:23: error: undefined reference to '$s13BluetoothGATT22ATTAttributePermissionON'
/home/andrea/Desktop/Punch/SwiftLinuxBLE/Sources/SwiftLinuxBLE/Characteristic.swift:24: error: undefined reference to '$s13BluetoothGATT22ATTAttributePermissionON'
/home/andrea/Desktop/Punch/SwiftLinuxBLE/Sources/SwiftLinuxBLE/Characteristic.swift:0: error: undefined reference to '$s13BluetoothGATT13GATTAttributeO10DescriptorVN'
/home/andrea/Desktop/Punch/SwiftLinuxBLE/Sources/SwiftLinuxBLE/Characteristic.swift:44: error: undefined reference to '$s13BluetoothGATT37GATTClientCharacteristicConfigurationV13configurationAC0A016BitMaskOptionSetVyAC0E0OG_tcfC'
/home/andrea/Desktop/Punch/SwiftLinuxBLE/Sources/SwiftLinuxBLE/Characteristic.swift:44: error: undefined reference to '$s13BluetoothGATT37GATTClientCharacteristicConfigurationV10descriptorAA13GATTAttributeO10DescriptorVvg'
/home/andrea/Desktop/Punch/SwiftLinuxBLE/Sources/SwiftLinuxBLE/Characteristic.swift:44: error: undefined reference to '$s13BluetoothGATT13GATTAttributeO10DescriptorVN'
/home/andrea/Desktop/Punch/SwiftLinuxBLE/Sources/SwiftLinuxBLE/Characteristic.swift:0: error: undefined reference to '$s13BluetoothGATT13GATTAttributeO10DescriptorVN'
<compiler-generated>:0: error: undefined reference to '$s13BluetoothGATT37GATTClientCharacteristicConfigurationV0E0ON'
<compiler-generated>:0: error: undefined reference to '$s13BluetoothGATT26GATTCharacteristicPropertyOSHAAMc'
<compiler-generated>:0: error: undefined reference to '$s13BluetoothGATT37GATTClientCharacteristicConfigurationV0E0O0A013BitMaskOptionAAMc'
<compiler-generated>:0: error: undefined reference to '$s13BluetoothGATT37GATTClientCharacteristicConfigurationV0E0ON'
/home/andrea/Desktop/Punch/SwiftLinuxBLE/.build/x86_64-unknown-linux-gnu/debug/SwiftLinuxBLE.build/Characteristic.swift.o(.data.rel.ro+0x8): error: undefined reference to '$s13BluetoothGATT26GATTCharacteristicPropertyOMn'
/home/andrea/Desktop/Punch/SwiftLinuxBLE/.build/x86_64-unknown-linux-gnu/debug/SwiftLinuxBLE.build/Characteristic.swift.o(.data.rel.ro+0x10): error: undefined reference to '$s13BluetoothGATT22ATTAttributePermissionOMn'
/home/andrea/Desktop/Punch/SwiftLinuxBLE/.build/x86_64-unknown-linux-gnu/debug/SwiftLinuxBLE.build/Characteristic.swift.o(.data.rel.ro+0x168): error: undefined reference to '$s13BluetoothGATT13GATTAttributeO10DescriptorVMn'
<compiler-generated>:0: error: undefined reference to '$s13BluetoothGATT26ATTMaximumTransmissionUnitV3maxACvgZ'
/home/andrea/Desktop/Punch/SwiftLinuxBLE/Sources/SwiftLinuxBLE/Peripheral.swift:35: error: undefined reference to '$s13BluetoothGATT13GATTAttributeO14CharacteristicVN'
/home/andrea/Desktop/Punch/SwiftLinuxBLE/Sources/SwiftLinuxBLE/Peripheral.swift:39: error: undefined reference to '$s13BluetoothGATT13GATTAttributeO7ServiceV4uuid7primary15characteristics16includedServicesAE0A00A4UUIDO_SbSayAC14CharacteristicVGSayAC7IncludeVGtcfC'
inuxBLE/Peripheral.swift:46: error: undefined reference to '$s13BluetoothGATT13GATTAttributeO10DescriptorVN'
/home/andrea/Desktop/Punch/SwiftLinuxBLE/Sources/SwiftLinuxBLE/Peripheral.swift:36: error: undefined reference to '$s13BluetoothGATT13GATTAttributeO14CharacteristicV4uuid5value11permissions10properties11descriptorsAE0A00A4UUIDO_10Foundation4DataVAK16BitMaskOptionSetVyAA22ATTAttributePermissionOGARyAA26GATTCharacteristicPropertyOGSayAC10DescriptorVGtcfC'
<compiler-generated>:0: error: undefined reference to '$s13BluetoothGATT13GATTAttributeO7IncludeVN'
/home/andrea/Desktop/Punch/SwiftLinuxBLE/.build/x86_64-unknown-linux-gnu/debug/SwiftLinuxBLE.build/Peripheral.swift.o(.data.rel.ro+0x28): error: undefined reference to '$s13BluetoothGATT22ATTAttributePermissionOMn'
<compiler-generated>:0: error: undefined reference to '$s13BluetoothGATT26GATTCharacteristicPropertyO0A013BitMaskOptionAAMc'
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
[0/1] Linking SwiftLinuxBLEPackageTests.xctest
error: fatalError

It seems that is looking for some methods and properties that should be present in BluetoothGATT but it can't find them. Fun fact on macOs build and test fine.

Can someone point me to the right direction?
Best,
Andrea

Terms of Service

Privacy Policy

Cookie Policy