question

Erri-2940 avatar image
0 Votes"
Erri-2940 asked DavidLowndes-6766 answered

unresolved external symbol __imp_select referenced in function main

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

c++
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

DavidLowndes-6766 avatar image
1 Vote"
DavidLowndes-6766 answered

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.

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

how do i add it to this line: $(CoreLibraryDependencies);%(AdditionalDependencies)

0 Votes 0 ·

Ok actually I think i found out just add ;Ws2_32.lib to the end of the line so $(CoreLibraryDependencies);%(AdditionalDependencies);Ws2_32.lib

0 Votes 0 ·

Also thanks.

0 Votes 0 ·