0

Hi,

I need to link a library you can download from producer's site (http://www.dahuasecurity.com/download_3.html) to my c++ project. The library is named General_NetSDK_Eng_Windows64_IS_V3.40.2.R.130321.7z. I tried to:

  • Linker->Input : added to addidiontal dependencies lines:

    dhnetsdk.lib
    dhconfigsdk.lib

  • Linked->General : added to additional library directories a "D:\dahua\" directory which includes files dhnetsdk.lib, dhnetsdk.dll, dhnetsdk.h and dhconfigsdk.lib, dhconfigsdk.dll

  • C/C++->General : added to additional include directories a "D:\dahua\" directory

I included files by directive #include : dhnetsdk.h and dhconfigsdk.h. I also copied all library files (.lib, .dll, .h) to my application source code direcotry and debug directory.

Unfortunately I still get errors LNK2019 and LNK1120. What am I doing wrong?

3
Contributors
4
Replies
35
Views
3 Years
Discussion Span
Last Post by bejfake
0

You might have that problem if the library was built a C code and your program is attempting to call it's functions as C++ code. If that is the case then you need to tell the compiler that the library is C and not C++.

#ifdef __cplusplus
extern "C" {
#endif
#include "dhnetsdk.h"
#ifdef __cplusplus
}
#endif

Edited by Ancient Dragon

0

Your solution doesn't work, still LNK2019 and LNK1120

Edited by bejfake

0

I forgot to write here. I solved this problem, you are right - it was problem with architecture. I had to build as Win64. I worked it out myself, but anyway thank you.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.