title: Undefined symbols for architecture x86_64 in Xcode 8.3.3 for iOS app
body: <p>I have just created a new project in Xcode 8.3.3 with Swift for iOS and
  I tried importing the external library <a href="https://github.com/ktsakaguchi/SwiftLibModbus" rel="nofollow noreferrer">SwiftLibModbus</a></p>
  
  <p>I have ported the library to use Swift 3 (meaning, I fixed all the errors).
  This library is using another library named <code>libmodbus</code> that is written in <code>C</code> and I am getting an <code>Undefined symbols for architecture x86_64</code> error when this library is imported.</p>
  
  <p>Here is the full error:</p>
  
  <pre><code>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)
  </code></pre>
  
  <p>Is there any way around this?
  This is actually the only library I have found available for Modbus.</p>
  
  <p>Thanks :) </p>