By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,918 Members | 2,258 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,918 IT Pros & Developers. It's quick & easy.

error LNK2019

P: 9
Hello,
I have the following problem. I keep getting these linker errors, although I included all the header files and provided the right settings for the project.
I use the C++ compiler in .NET framework.

Here are the linker erros:

NetworkAnalyzer error LNK2019: unresolved external symbol "class nbPacketDecoder * __cdecl nbGetPacketDecoder(int,char *,int)" referenced in function "public: __thiscall CCaptureWindow::CCaptureWindow(class wxWindow *,struct _capsettings *)"

NetworkAnalyzer error LNK2019: unresolved external symbol "class nbPDMLReader * __cdecl nbGetPDMLReader(char *,char *,int)" referenced in function "public: int __thiscall CCaptureWindow::LoadPDMLBuffer(class wxString)"

The project settings are:


  • in C/C++ settings
    • General: Additional Include Directories: ../nbDevPack/NetBee/Include
    • Preprocessor: WIN32;_DEBUG;__WXDEBUG__;__WXMSW__;_WINDOWS;NOPCH; _CRTDBG_MAP_ALLOC;STRICT;_WINSOCKAPI_;WPCAP;HAVE_R EMOTE
  • in Linker settings:
    • General: Additional Libraries Directories ../nbDevPack/NetBee/Lib
    • Input: Ignore specific library: MSVCRTD.lib
In ../nbDevPack/NetBee/Include, I have all the header files I need(this an external open source library I downloaded from the internet).
However, it seems it isn't capable to find those functions even if they are defined in the headers from ../NetBee/Include.
The library itself is packed as a .lib file and as a .exp file in the directory /NettBee/Lib

The .cpp files are built with C/C++ Build Tool and the header files with the Custom Build Tool provided by the .NET framework.

Please help. Thank you,

Adina
Mar 11 '07 #1
Share this Question
Share on Google+
3 Replies


P: 9
Hello,
I have the following problem. I keep getting these linker errors, although I included all the header files and provided the right settings for the project.
I use the C++ compiler in .NET framework.

Here are the linker erros:

NetworkAnalyzer error LNK2019: unresolved external symbol "class nbPacketDecoder * __cdecl nbGetPacketDecoder(int,char *,int)" referenced in function "public: __thiscall CCaptureWindow::CCaptureWindow(class wxWindow *,struct _capsettings *)"

NetworkAnalyzer error LNK2019: unresolved external symbol "class nbPDMLReader * __cdecl nbGetPDMLReader(char *,char *,int)" referenced in function "public: int __thiscall CCaptureWindow::LoadPDMLBuffer(class wxString)"

The project settings are:
in C/C++ settings

General: Additional Include Directories: ../nbDevPack/NetBee/Include
Preprocessor:
WIN32;_DEBUG;__WXDEBUG__;__WXMSW__;
_WINDOWS;NOPCH;_CRTDBG_MAP_ALLOC;STRICT;
_WINSOCKAPI_;WPCAP;HAVE_REMOTE

in Linker settings:


General
: Additional Libraries Directories ../nbDevPack/NetBee/Lib
Input: Ignore specific library: MSVCRTD.lib

In ../nbDevPack/NetBee/Include, I have all the header files I need(this an external open source library I downloaded from the internet).

However, it seems it isn't capable to find those functions even if they are defined in the headers from ../NetBee/Include.
The library itself is packed as a .lib file and as a .exp file in the directory /NettBee/Lib

The .cpp files are built with C/C++ Build Tool and the header files with the Custom Build Tool provided by the .NET framework.

Please help. Thank you,

Adina
Mar 11 '07 #2

100+
P: 180
There is no problem with including header files. By seeing the statements above I guess the library is not linked.

Did you make your application dependent on that library??? Right clik on your application then clik on Project dependencies. Check your library in the check box provided.

Check the path of the library properly.

If doesnt work please provide some more details about how you have been proceeding.
Mar 12 '07 #3

P: 9
Hello,
It works thank you. I found out that there is another way to do this, besides changing the Additional Dependencies. I'll post this in case someone out there might need it.
The idea is to add the following line:
#pragma comment(lib, "libname.lib") where the "libname" is the name of the library in the lib folder which the application requires.
I have tried to add this line in my header where I have data members of a class that require this library and in my .cpp file where I actually use those functions that triggered the LNK2019 error. I worked both ways.
Still, I've read it's better to put this line in the .cpp file since it gets compiled only once.

Thanks again,
Adina
Mar 14 '07 #4

Post your reply

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