Linker error in various netxms projects

Started by antonyvasanth, December 04, 2008, 01:28:13 PM

Previous topic - Next topic

antonyvasanth

Hi victor,

As you have suggested i have downloaded the following files from

http://www.christopherlewis.com/WGet/WGetFiles.htm

Files :

     ssllibs.098b.b.zip : ZIP file containing the 098b SSL DLLs including MSVCR80.dll.
     openssl.098b.full.zip : Full OpenSSL directory built from source using VC++ 2005

and included the executable,include and library path. After compiling I getting the following errors

1. libnetxms

Linking...
   Creating library Debug/libnetxms.lib and object Debug/libnetxms.exp
nxcp.obj : error LNK2001: unresolved external symbol _CSCPDecryptMessage
nxcp.obj : error LNK2001: unresolved external symbol _CSCPEncryptMessage
StackWalker.obj : error LNK2001: unresolved external symbol __imp__GetUserNameA@8
Debug/libnetxms.dll : fatal error LNK1120: 3 unresolved externals
Error executing link.exe.
Creating browse info file...

2. libnxsrv

Creating library Debug/libnxsrv.lib and object Debug/libnxsrv.exp
agent.obj : error LNK2001: unresolved external symbol __imp__DestroyEncryptionContext
agent.obj : error LNK2001: unresolved external symbol __imp__CSCPEncryptMessage
agent.obj : error LNK2001: unresolved external symbol __imp__SetupEncryptionContext
agent.obj : error LNK2001: unresolved external symbol __imp__PrepareKeyRequestMsg
Debug/libnxsrv.dll : fatal error LNK1120: 4 unresolved externals
Error executing link.exe.

3. nxaction

nxaction.obj : error LNK2001: unresolved external symbol __imp__LoadRSAKeys
nxaction.obj : error LNK2001: unresolved external symbol __imp__InitCryptoLib
Debug/nxaction.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.

4. nxagentd

getparam.obj : error LNK2001: unresolved external symbol __imp__CSCPGetSupportedCiphers
nxagentd.obj : error LNK2001: unresolved external symbol __imp__InitCryptoLib
session.obj : error LNK2001: unresolved external symbol __imp__DestroyEncryptionContext
session.obj : error LNK2001: unresolved external symbol __imp__SetupEncryptionContext
session.obj : error LNK2001: unresolved external symbol __imp__CSCPEncryptMessage
Debug/nxagentd.exe : fatal error LNK1120: 5 unresolved externals
Error executing link.exe.

5.nxcon

comm.cpp
F:\project-development\netxms-0.2.22\netxms-0.2.22\src\console\win32\comm.cpp(153) : error C2065: 'SignMessageWithCAPI' : undeclared identifier
Generating Code...

6. nxget

nxget.obj : error LNK2001: unresolved external symbol __imp__LoadRSAKeys
nxget.obj : error LNK2001: unresolved external symbol __imp__InitCryptoLib
Debug/nxget.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.

7. nxupload

nxupload.obj : error LNK2001: unresolved external symbol __imp__LoadRSAKeys
nxupload.obj : error LNK2001: unresolved external symbol __imp__InitCryptoLib
Debug/nxupload.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.

Kindly please help me to resolve the errors ..If you could give me the openssl 0.9.8b download link I will be grateful. Also please suggest me is there any alternative cause.

Regards,

Antony vasanth



antonyvasanth

Hi victor ,

I have installed OpenSSL 0.9.8g

I have got the following error under libnetnms project.I hope if libnetnms is created most of the errors which depends on libnetnms will be resolved.Please suggest me which version i can download and install.If you can provide me the link i will be greatful. Thanks.


C:\OpenSSL\lib\Builder5\libeay32.lib : fatal error LNK1136: invalid or corrupt file
Error executing link.exe.
Creating browse info file...


Regards,

Antony vasanth.


Victor Kirhenshtein

Most likely you should have OpenSSL compiled with VC6. You can get headers and libs that I use at https://www.netxms.org/download/dev/openssl-0.9.8b-vc6.tar.gz.

Best regards,
Victor

antonyvasanth

Hi victor,

I have got the same linker errors even after using the Openssl which you have provided me.I have seen that in nxcpapi.h the various functions are defined. Eventhough it is included in the source files the external symbol error occurs. I am not getting any clue on this error. Please help me to resolve the same.

Regards,

Antony vasanth.

Victor Kirhenshtein

Hi!

Did you compile crypto.cpp as part of libnetxms?

Best regards,
Victor

antonyvasanth

Hi victor,

yes i have compiled the crypto.cpp as part of libnetxms project.


--------------------Configuration: libnetxms - Win32 Debug--------------------
Compiling...
base64.cpp
config.cpp
dir.c
dload.cpp
gen_uuid.c
getopt.c
hash.cpp
icmp.cpp
inline.cpp
main.cpp
md5.cpp
message.cpp
msgwq.cpp
nxcp.cpp
qsort.c
queue.cpp
regex.c
rwlock.cpp
scandir.c
seh.cpp
serial.cpp
sha1.cpp
StackWalker.cpp
string.cpp
strmap.cpp
strtoll.c
strtoull.c
table.cpp
tools.cpp
unicode.cpp
uuid.c
wcstoll.c
wcstoull.c
xml.cpp
crypto.cpp
Linking...
   Creating library Debug/libnetxms.lib and object Debug/libnetxms.exp
StackWalker.obj : error LNK2001: unresolved external symbol __imp__GetUserNameA@8
crypto.obj : error LNK2001: unresolved external symbol __imp__CryptReleaseContext@8
crypto.obj : error LNK2001: unresolved external symbol __imp__CryptDestroyHash@4
crypto.obj : error LNK2001: unresolved external symbol __imp__CryptSignHashA@24
crypto.obj : error LNK2001: unresolved external symbol __imp__CryptHashData@16
crypto.obj : error LNK2001: unresolved external symbol __imp__CryptCreateHash@20
crypto.obj : error LNK2001: unresolved external symbol __imp__CryptAcquireCertificatePrivateKey@24
Debug/libnetxms.dll : fatal error LNK1120: 7 unresolved externals


Kindly please help me how to resolve the errors ..Thanks in advance.


Regards,

Antony vasanth


Victor Kirhenshtein

All these Crypt functions are from advapi32.dll. Ensure that advapi32.lib is in library list for libnetxms and that you are using latest Windows Platform SDK.

Best regards,
Victor

antonyvasanth

#7
Hi victor,

           I have added the advapi32.lib library in the list of libnetxms and after compilation I have got the following linker errors. Could you please give me some suggestion on the library which has the following functions references. Thanks in Advance.


1.
--------------------Configuration: nxagentd - Win32 Debug--------------------
Linking...
comm.obj : error LNK2001: unresolved external symbol "char * g_szListenAddress" (?g_szListenAddress@@3PADA)
Debug/nxagentd.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

2.
--------------------Configuration: nxlexer - Win32 Release--------------------
Linking...
   Creating library Release/nxlexer.lib and object Release/nxlexer.exp
nxlexer.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall WindowAccessor::IndicatorFill(int,int,int,int)" (?IndicatorFill@WindowAccessor@@UAEXHHHH@Z)
nxlexer.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall WindowAccessor::IndentAmount(int,int *,bool (__cdecl*)(class Accessor &,int,int))" (?IndentAmount@WindowAccessor@@UAEHHPAHP6A_NAAVAccessor@@HH@Z@Z)
nxlexer.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall WindowAccessor::SetLevel(int,int)" (?SetLevel@WindowAccessor@@UAEXHH@Z)
nxlexer.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall WindowAccessor::ColourTo(unsigned int,int)" (?ColourTo@WindowAccessor@@UAEXIH@Z)
nxlexer.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall WindowAccessor::SetLineState(int,int)" (?SetLineState@WindowAccessor@@UAEHHH@Z)
nxlexer.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall WindowAccessor::GetLineState(int)" (?GetLineState@WindowAccessor@@UAEHH@Z)
nxlexer.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall WindowAccessor::Length(void)" (?Length@WindowAccessor@@UAEHXZ)
nxlexer.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall WindowAccessor::LevelAt(int)" (?LevelAt@WindowAccessor@@UAEHH@Z)
nxlexer.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall WindowAccessor::LineStart(int)" (?LineStart@WindowAccessor@@UAEHH@Z)
nxlexer.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall WindowAccessor::GetLine(int)" (?GetLine@WindowAccessor@@UAEHH@Z)
nxlexer.obj : error LNK2001: unresolved external symbol "public: virtual char __thiscall WindowAccessor::StyleAt(int)" (?StyleAt@WindowAccessor@@UAEDH@Z)
nxlexer.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall WindowAccessor::Match(int,char const *)" (?Match@WindowAccessor@@UAE_NHPBD@Z)
nxlexer.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall WindowAccessor::Fill(int)" (?Fill@WindowAccessor@@MAEXH@Z)
nxlexer.obj : error LNK2001: unresolved external symbol "protected: virtual bool __thiscall WindowAccessor::InternalIsLeadByte(char)" (?InternalIsLeadByte@WindowAccessor@@MAE_ND@Z)
nxlexer.obj : error LNK2001: unresolved external symbol "public: __thiscall PropSet::~PropSet(void)" (??1PropSet@@QAE@XZ)
nxlexer.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall WindowAccessor::~WindowAccessor(void)" (??1WindowAccessor@@UAE@XZ)
nxlexer.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall WindowAccessor::Flush(void)" (?Flush@WindowAccessor@@UAEXXZ)
nxlexer.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall WindowAccessor::StartSegment(unsigned int)" (?StartSegment@WindowAccessor@@UAEXI@Z)
nxlexer.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall WindowAccessor::StartAt(unsigned int,char)" (?StartAt@WindowAccessor@@UAEXID@Z)
nxlexer.obj : error LNK2001: unresolved external symbol "public: void __thiscall PropSet::SetMultiple(char const *)" (?SetMultiple@PropSet@@QAEXPBD@Z)
nxlexer.obj : error LNK2001: unresolved external symbol "public: __thiscall PropSet::PropSet(void)" (??0PropSet@@QAE@XZ)
nxlexer.obj : error LNK2001: unresolved external symbol "public: int __thiscall PropSet::GetInt(char const *,int)const " (?GetInt@PropSet@@QBEHPBDH@Z)
nxlexer.obj : error LNK2001: unresolved external symbol "public: char * __thiscall PropSet::ToString(void)const " (?ToString@PropSet@@QBEPADXZ)
Release/nxlexer.dll : fatal error LNK1120: 23 unresolved externals
Error executing link.exe.

3.
--------------------Configuration: nxuilib - Win32 Debug--------------------
Linking...
   Creating library Debug/nxuilib.lib and object Debug/nxuilib.exp
sapi.lib(sapilib.obj) : fatal error LNK1103: debugging information corrupt; recompile module
Error executing link.exe.




Regards,

Antony Vasanth.

Victor Kirhenshtein

Hi!

1. Looks like inconsistent source package. I will publish 0.2.23 tomorrow, try these sources.

2. Looks like you don't have scilexer.lib in nxlexer project library list.

3. Looks like you have sapi.lib incompatible with VC6. Try to find compatible one.

Best regards,
Victor