I'm new to VS, and I'm using Visual Studio .NET 2003.
I'm trying to write a program which uses pcap libraries. However, I keep getting the following errors:
error LNK2019: unresolved external symbol __imp__inet_nto a@4 referenced in function _got_packet
error LNK2019: unresolved external symbol __imp__ntohs@4 referenced in function _got_packet
error LNK2019: unresolved external symbol _Search referenced in function _got_packet
error LNK2019: unresolved external symbol _memcpy_s referenced in function _got_packet
The function got_packet is implemented in A.c, and the function Search is implemented in B.c. I also have corresponding header files A.h and B.h.
A.h looks somewhat like this (irrelevant code removed):
Expand|Select|Wrap|Line Numbers
- #ifndef A_H
- #define A_H
- #include <WinSock2.h>
- #include <windows.h>
- #include <stdio.h>
- #include <stdlib.h>
- #include <pcap.h>
- #include <string.h>
- #include <strsafe.h>
- #include "B.h"
- void got_packet(u_char *user, const struct pcap_pkthdr *header, const u_char *packet);
- #endif /* A_H */
Expand|Select|Wrap|Line Numbers
- #ifndef B_H
- #define B_H
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- __inline int Search( /* Function parameters */ );
- #endif /* B_H */
Thank you!
Regards,
Rayne