473,379 Members | 1,278 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Error LNK2019: unresolved external symbol

5
Hi all,
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_ntoa@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
  1. #ifndef A_H
  2. #define A_H
  3.  
  4. #include <WinSock2.h>
  5. #include <windows.h>
  6. #include <stdio.h>
  7. #include <stdlib.h>
  8. #include <pcap.h>
  9. #include <string.h>
  10. #include <strsafe.h>
  11.  
  12. #include "B.h"
  13.  
  14. void got_packet(u_char *user, const struct pcap_pkthdr *header, const u_char *packet);
  15.  
  16. #endif /* A_H */
B.h looks somewhat like this (irrelevant code removed):

Expand|Select|Wrap|Line Numbers
  1. #ifndef B_H
  2. #define B_H
  3.  
  4. #include <stdio.h>
  5. #include <stdlib.h>
  6. #include <string.h>
  7.  
  8. __inline int Search( /* Function parameters */ );
  9.  
  10. #endif /* B_H */
Why am I getting these errors and how can I solve them?

Thank you!

Regards,
Rayne
Nov 25 '09 #1
2 11458
gpraghuram
1,275 Expert 1GB
I think you havent included the winsock library in linker options.
Try to include winsock and winsock (libraries) and i think the issue will get resolved.


Raghu
Nov 25 '09 #2
hjazz
5
Thanks. I added ws2_32.lib and took out the __inline from my Search function, and the program ran successfully.
Nov 26 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Jennifer | last post by:
Could you please report the following problem to your VC customer support? THANKS! Jennifer The problem is specific to the VC.Net and VC.Net 2003 <xlocinfo> headers. The problem is that if...
2
by: AS | last post by:
Hi, I'm trying to use some power management features with windows 2000 Professional and I have visual studio .net 2003 installed with the latest service packs and everything... I want to write...
0
by: drumdawg21 | last post by:
Ive been working on this problem for a long time now and really need some help. I have a program in c++ code that gives me build errors and my program is having problems. I have two source files in...
3
by: YAN KANG / SU | last post by:
Hi, All I am migrating to Studio .NET 2003 from Studio 6.0 and Studio .NET 2002. When I compiled my code, which is compilable both in VC++ 6.0 and Studio .NET 2002, I have an error LNK2019 as the...
8
by: Bruce Schechter | last post by:
I am quite experienced with vs.net 2003 and c# but fairly new to c++. I have a test app in c++ that I need to compile for a c#/c++ interop evaluation I'm doing. But first, I simply need to...
4
by: naveenadevi | last post by:
Hi, I'm trying to use some power management features with windowsx xp and I have visual studio .net 2003 installed. As per documentation of ACPI, you can use the power options by including...
3
by: NewsGroup | last post by:
Hello, I am trying to write a code to interface with ILOG OPL development studio using their C++ libraries and header files. But I am encountering linker issues, an example being - error...
2
by: f rom | last post by:
----- Forwarded Message ---- From: Josiah Carlson <jcarlson@uci.edu> To: f rom <etaoinbe@yahoo.com>; wxpython-users@lists.wxwidgets.org Sent: Monday, December 4, 2006 10:03:28 PM Subject: Re: ...
2
by: Rafael Douglas | last post by:
Hello All, I was writing a program and ran across this error: error LNK2019: unresolved external symbol "double __cdecl setTotalCost(void)" (?setTotalCost@@YANXZ) referenced in function _main...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.