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

Technote (troubleshooting)


Problem(Abstract)

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.

Rate this page:

(0 users)Average rating

Document information


More support for:

Rational Test RealTime
Runtime Analysis

Software version:

8.0, 8.0.0.1, 8.0.0.2, 8.0.0.3, 8.0.0.4

Operating system(s):

Windows

Reference #:

1615574

Modified date:

2013-06-17

Translate my page

Machine Translation

Content navigation