unresolved external symbol __imp_select referenced in function main

Erri 21 Reputation points
2022-05-25T21:22:55.177+00:00

Hi I'm getting these errors, is there any way to fix this for a c program in a c++solution? Maybe so I don't have to use different functions?

Severity Code Description
Error LNK2019 unresolved external symbol __WSAFDIsSet referenced in function main
Error LNK2019 unresolved external symbol __imp_accept referenced in function main
Error LNK2019 unresolved external symbol __imp_bind referenced in function main
Error LNK2019 unresolved external symbol __imp_htons referenced in function main
Error LNK2019 unresolved external symbol __imp_listen referenced in function main
Error LNK2019 unresolved external symbol __imp_recv referenced in function main
Error LNK2019 unresolved external symbol __imp_select referenced in function main
Error LNK2019 unresolved external symbol __imp_send referenced in function main
Error LNK2019 unresolved external symbol __imp_socket referenced in function main
Error LNK2019 unresolved external symbol __imp_gethostbyaddr referenced in function main

Developer technologies | C++
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. David Lowndes 4,726 Reputation points
    2022-05-25T21:38:31.593+00:00

    I think you need to add Ws2_32.lib to your project's linker libraries. See the Linker, Input, Additional Dependencies if you're using Visual Studio.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.