IBM Support

Build of BaseStation test node in BaseStation_C sample failed with error LNK2019

Troubleshooting


Problem

Attempts to build BaseStation node results in "LNK2019" error in IBM Rational Test RealTime.

Symptom

The full error message is as follows:

UmtsServer.obj : warning LNK4217: locally defined symbol __atp_malloc imported in function "public: __thiscall List::List(int)" (??0List@@QAE@H@Z)

UmtsServer.obj : warning LNK4217: locally defined symbol __atp_free imported in function "public: __thiscall List::~List(void)" (??1List@@QAE@XZ)

tcpsck.obj : error LNK2019: unresolved external symbol _htons@4 referenced in function _tcpsck_set_addr

tcpsck.obj : error LNK2019: unresolved external symbol _gethostbyname@4 referenced in function _tcpsck_set_addr

tcpsck.obj : error LNK2019: unresolved external symbol _WSAStartup@8 referenced in function _tcpsck_init

tcpsck.obj : error LNK2019: unresolved external symbol _setsockopt@20 referenced in function _tcpsck_new_socket

tcpsck.obj : error LNK2019: unresolved external symbol _socket@12 referenced in function _tcpsck_new_socket

tcpsck.obj : error LNK2019: unresolved external symbol _listen@8 referenced in function _tcpsck_bind_and_listen

tcpsck.obj : error LNK2019: unresolved external symbol _bind@12 referenced in function _tcpsck_bind_and_listen

tcpsck.obj : error LNK2019: unresolved external symbol _gethostname@8 referenced in function _tcpsck_gethostname

tcpsck.obj : error LNK2019: unresolved external symbol _ntohs@4 referenced in function _tcpsck_get_port

tcpsck.obj : error LNK2019: unresolved external symbol _getsockname@12 referenced in function _tcpsck_get_port

tcpsck.obj : error LNK2019: unresolved external symbol _accept@12 referenced in function _tcpsck_accept

tcpsck.obj : error LNK2019: unresolved external symbol _connect@12 referenced in function _tcpsck_connect

tcpsck.obj : error LNK2019: unresolved external symbol _closesocket@4 referenced in function _tcpsck_close

tcpsck.obj : error LNK2019: unresolved external symbol _send@16 referenced in function _tcpsck_send

tcpsck.obj : error LNK2019: unresolved external symbol ___WSAFDIsSet@8 referenced in function _tcpsck_data_ready

tcpsck.obj : error LNK2019: unresolved external symbol _select@20 referenced in function _tcpsck_data_ready

tcpsck.obj : error LNK2019: unresolved external symbol _recv@16 referenced in function _tcpsck_recv

tcpsck.obj : error LNK2019: unresolved external symbol _WSACleanup@0 referenced in function _tcpsck_end

tcpsck.obj : error LNK2019: unresolved external symbol _WSAGetLastError@0 referenced in function _tcpsck_get_last_error

.\cvisual9\BaseStation.exe : fatal error LNK1120: 19 unresolved externals

status 96

Cause

Applications that use Winsock must be linked with the Ws2_32.lib library file.

Resolving The Problem

Procedure:

  1. Open BaseStation Configuration Settings by clicking on menu Project > Settings...

  2. Navigate to Configuration properties > Build > Linker

  3. Move to the panel on right-side and add "ws2_32.lib" into Additional objects and libraries followed by clicking on Apply

  4. Click OK to close the BaseStation Configuration Settings

  5. Rebuild BaseStation test node.

[{"Product":{"code":"SSSHUF","label":"Rational Test RealTime"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Runtime Analysis","Platform":[{"code":"PF033","label":"Windows"}],"Version":"8.0;8.0.0.1;8.0.0.2;8.0.0.3;8.0.0.4","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
16 June 2018

UID

swg21615574