I am new to winsock and went through a tutorial and made a program similar to the one in the tutorial. When compiling no syntax errors or anything but it came up with a list of linking errors. I don't understand this because the linking errors are about the basic commands like WSAStartup, WSACleanup,accept,bind,etc. Here are the errors:
Code:
C:\WINDOWS\TEMP\ccz22ggb.o(.text+0x127):winsock.cpp: undefined reference to `WSAStartup@8'
C:\WINDOWS\TEMP\ccz22ggb.o(.text+0x138):winsock.cpp: undefined reference to `socket@12'
C:\WINDOWS\TEMP\ccz22ggb.o(.text+0x164):winsock.cpp: undefined reference to `WSACleanup@0'
C:\WINDOWS\TEMP\ccz22ggb.o(.text+0x18c):winsock.cpp: undefined reference to `htons@4'
C:\WINDOWS\TEMP\ccz22ggb.o(.text+0x1b0):winsock.cpp: undefined reference to `bind@12'
C:\WINDOWS\TEMP\ccz22ggb.o(.text+0x1dc):winsock.cpp: undefined reference to `WSACleanup@0'
C:\WINDOWS\TEMP\ccz22ggb.o(.text+0x1f4):winsock.cpp: undefined reference to `listen@8'
C:\WINDOWS\TEMP\ccz22ggb.o(.text+0x220):winsock.cpp: undefined reference to `WSACleanup@0'
C:\WINDOWS\TEMP\ccz22ggb.o(.text+0x237):winsock.cpp: undefined reference to `accept@12'
C:\WINDOWS\TEMP\ccz22ggb.o(.text+0x263):winsock.cpp: undefined reference to `WSACleanup@0'
C:\WINDOWS\TEMP\ccz22ggb.o(.text+0x27b):winsock.cpp: undefined reference to `closesocket@4'
C:\WINDOWS\TEMP\ccz22ggb.o(.text+0x28d):winsock.cpp: undefined reference to `closesocket@4'
C:\WINDOWS\TEMP\ccz22ggb.o(.text+0x295):winsock.cpp: undefined reference to `WSACleanup@0'
I included windows.h, winsock.h, and stdio.h. Do I need to link a library as well or why are these errors coming up?