Welcome to OCS Inventory NG community support, where you can ask questions and receive answers from other members of the community.

Please ask questions only in English or French.

Release 2.5 available

The official documentation can be found on http://wiki.ocsinventory-ng.org. Read it before asking your question.

Unable to build windows agent

Hello,

I try to build the Windows Agent uner Windows 10 with Visual Studio 2017 community Edition.

All external dependencies built fine (after modifying it here and there).

But I can't build the agent itself.

Here I get:

Severity    Code    Description    Project    File    Line    Suppression State
Error    C2248    'ATL::CA2WEX<128>::CA2WEX': cannot access private member declared in class 'ATL::CA2WEX<128>'    OCSInventory Front    c:\users\ds\downloads\ocs-windows-agent\windowsagent\ocsinventory front\markup.cpp    561  
Warning    C4715    'COcsWmi::GetClassObjectLength': not all control paths return a value    OcsWmi    c:\users\ds\downloads\ocs-windows-agent\windowsagent\ocswmi\ocswmi.cpp    339  
Warning    C4715    'COcsWmi::GetRefElementClassObjectLength': not all control paths return a value    OcsWmi    c:\users\ds\downloads\ocs-windows-agent\windowsagent\ocswmi\ocswmi.cpp    537  
Warning    C4996    'GetVersion': was declared deprecated    SysInfo    c:\users\ds\downloads\ocs-windows-agent\windowsagent\sysinfo\dtwinver.cpp    1373  
Error    C4839    non-standard use of class 'ATL::CA2WEX<128>' as an argument to a variadic function    SysInfo    c:\users\ds\downloads\ocs-windows-agent\windowsagent\sysinfo\edid.cpp    590  
Error    C2248    'ATL::CA2WEX<128>::CA2WEX': cannot access private member declared in class 'ATL::CA2WEX<128>'    SysInfo    c:\users\ds\downloads\ocs-windows-agent\windowsagent\sysinfo\edid.cpp    590  
Error    C4839    non-standard use of class 'ATL::CA2WEX<128>' as an argument to a variadic function    SysInfo    c:\users\ds\downloads\ocs-windows-agent\windowsagent\sysinfo\edid.cpp    591  
Error    C2248    'ATL::CA2WEX<128>::CA2WEX': cannot access private member declared in class 'ATL::CA2WEX<128>'    SysInfo    c:\users\ds\downloads\ocs-windows-agent\windowsagent\sysinfo\edid.cpp    591  
Error    C4839    non-standard use of class 'ATL::CA2WEX<128>' as an argument to a variadic function    SysInfo    c:\users\ds\downloads\ocs-windows-agent\windowsagent\sysinfo\edid.cpp    594  
Error    C2248    'ATL::CA2WEX<128>::CA2WEX': cannot access private member declared in class 'ATL::CA2WEX<128>'    SysInfo    c:\users\ds\downloads\ocs-windows-agent\windowsagent\sysinfo\edid.cpp    594  
Error    C4839    non-standard use of class 'ATL::CA2WEX<128>' as an argument to a variadic function    SysInfo    c:\users\ds\downloads\ocs-windows-agent\windowsagent\sysinfo\edid.cpp    596  
Error    C2248    'ATL::CA2WEX<128>::CA2WEX': cannot access private member declared in class 'ATL::CA2WEX<128>'    SysInfo    c:\users\ds\downloads\ocs-windows-agent\windowsagent\sysinfo\edid.cpp    596  
Error    C4839    non-standard use of class 'ATL::CA2WEX<128>' as an argument to a variadic function    SysInfo    c:\users\ds\downloads\ocs-windows-agent\windowsagent\sysinfo\edid.cpp    680  
Error    C2248    'ATL::CA2WEX<128>::CA2WEX': cannot access private member declared in class 'ATL::CA2WEX<128>'    SysInfo    c:\users\ds\downloads\ocs-windows-agent\windowsagent\sysinfo\edid.cpp    680  
Error    C4839    non-standard use of class 'ATL::CA2WEX<128>' as an argument to a variadic function    SysInfo    c:\users\ds\downloads\ocs-windows-agent\windowsagent\sysinfo\edid.cpp    681  
Error    C2248    'ATL::CA2WEX<128>::CA2WEX': cannot access private member declared in class 'ATL::CA2WEX<128>'    SysInfo    c:\users\ds\downloads\ocs-windows-agent\windowsagent\sysinfo\edid.cpp    681  
Error    C4839    non-standard use of class 'ATL::CA2WEX<128>' as an argument to a variadic function    SysInfo    c:\users\ds\downloads\ocs-windows-agent\windowsagent\sysinfo\edid.cpp    684  
Error    C2248    'ATL::CA2WEX<128>::CA2WEX': cannot access private member declared in class 'ATL::CA2WEX<128>'    SysInfo    c:\users\ds\downloads\ocs-windows-agent\windowsagent\sysinfo\edid.cpp    684  
Error    C4839    non-standard use of class 'ATL::CA2WEX<128>' as an argument to a variadic function    SysInfo    c:\users\ds\downloads\ocs-windows-agent\windowsagent\sysinfo\edid.cpp    686  
Error    C2248    'ATL::CA2WEX<128>::CA2WEX': cannot access private member declared in class 'ATL::CA2WEX<128>'    SysInfo    c:\users\ds\downloads\ocs-windows-agent\windowsagent\sysinfo\edid.cpp    686  
Warning    C4244    'argument': conversion from 'ULONG64' to 'ULONG', possible loss of data    SysInfo    c:\users\ds\downloads\ocs-windows-agent\windowsagent\sysinfo\iphelper.cpp    373  
Warning    C4244    'argument': conversion from 'ULONG64' to 'ULONG', possible loss of data    SysInfo    c:\users\ds\downloads\ocs-windows-agent\windowsagent\sysinfo\iphelper.cpp    413  
Error    C4839    non-standard use of class 'ATL::CA2WEX<128>' as an argument to a variadic function    SysInfo    c:\users\ds\downloads\ocs-windows-agent\windowsagent\sysinfo\iphelper.cpp    495  
Error    C2248    'ATL::CA2WEX<128>::CA2WEX': cannot access private member declared in class 'ATL::CA2WEX<128>'    SysInfo    c:\users\ds\downloads\ocs-windows-agent\windowsagent\sysinfo\iphelper.cpp    495  
Warning    C4996    'GetVersionExW': was declared deprecated    SysInfo    c:\users\ds\downloads\ocs-windows-agent\windowsagent\sysinfo\ocsprocess.cpp    58  
Warning    C4996    'GetVersionExW': was declared deprecated    SysInfo    c:\users\ds\downloads\ocs-windows-agent\windowsagent\sysinfo\registry.cpp    249  
Warning    C4477    'swscanf' : format string '%c' requires an argument of type 'wchar_t *', but variadic argument 1 has type 'DWORD_PTR *'    SysInfo    c:\users\ds\downloads\ocs-windows-agent\windowsagent\sysinfo\storageperipheral.cpp    269  
Warning    C4474    'swscanf' : too many arguments passed for format string    SysInfo    c:\users\ds\downloads\ocs-windows-agent\windowsagent\sysinfo\storageperipheral.cpp    269  
Warning    C4244    'argument': conversion from 'unsigned __int64' to 'LONG', possible loss of data    SysInfo    c:\users\ds\downloads\ocs-windows-agent\windowsagent\sysinfo\wmi.cpp    2057  
Warning    C4244    'argument': conversion from 'unsigned __int64' to 'LONG', possible loss of data    SysInfo    c:\users\ds\downloads\ocs-windows-agent\windowsagent\sysinfo\wmi.cpp    2059  
Error    C1083    Cannot open include file: 'zlib.h': No such file or directory    OCSInventory Front    c:\users\ds\downloads\ocs-windows-agent\windowsagent\ocsinventory front\flate.cpp    15  
Warning    C4244    'argument': conversion from 'ULONGLONG' to 'ULONG', possible loss of data    OCSInventory Front    c:\users\ds\downloads\ocs-windows-agent\windowsagent\ocsinventory front\inventoryrequest.cpp    875  
Error    C4839    non-standard use of class 'ATL::CA2WEX<128>' as an argument to a variadic function    OCSInventory Front    c:\users\ds\downloads\ocs-windows-agent\windowsagent\ocsinventory front\markup.cpp    428  
Error    C2248    'ATL::CA2WEX<128>::CA2WEX': cannot access private member declared in class 'ATL::CA2WEX<128>'    OCSInventory Front    c:\users\ds\downloads\ocs-windows-agent\windowsagent\ocsinventory front\markup.cpp    428  
Error    C4839    non-standard use of class 'ATL::CA2WEX<128>' as an argument to a variadic function    OCSInventory Front    c:\users\ds\downloads\ocs-windows-agent\windowsagent\ocsinventory front\markup.cpp    452  
Error    C2248    'ATL::CA2WEX<128>::CA2WEX': cannot access private member declared in class 'ATL::CA2WEX<128>'    OCSInventory Front    c:\users\ds\downloads\ocs-windows-agent\windowsagent\ocsinventory front\markup.cpp    452  
Error    C4839    non-standard use of class 'ATL::CA2WEX<128>' as an argument to a variadic function    OCSInventory Front    c:\users\ds\downloads\ocs-windows-agent\windowsagent\ocsinventory front\markup.cpp    552  
Error    C2248    'ATL::CA2WEX<128>::CA2WEX': cannot access private member declared in class 'ATL::CA2WEX<128>'    OCSInventory Front    c:\users\ds\downloads\ocs-windows-agent\windowsagent\ocsinventory front\markup.cpp    552  
Error    C4839    non-standard use of class 'ATL::CA2WEX<128>' as an argument to a variadic function    OCSInventory Front    c:\users\ds\downloads\ocs-windows-agent\windowsagent\ocsinventory front\markup.cpp    561  
Error    C4839    non-standard use of class 'ATL::CA2WEX<128>' as an argument to a variadic function    OCSInventory Front    c:\users\ds\downloads\ocs-windows-agent\windowsagent\ocsinventory front\markup.cpp    565  
Error    C2248    'ATL::CA2WEX<128>::CA2WEX': cannot access private member declared in class 'ATL::CA2WEX<128>'    OCSInventory Front    c:\users\ds\downloads\ocs-windows-agent\windowsagent\ocsinventory front\markup.cpp    565  
Warning    C4996    'GetVersionExW': was declared deprecated    OCSInventory Front    c:\users\ds\downloads\ocs-windows-agent\windowsagent\ocsinventory front\notifyuser.cpp    28  
Error    C1083    Cannot open include file: 'openssl/evp.h': No such file or directory    OCSInventory Front    c:\users\ds\downloads\ocs-windows-agent\windowsagent\ocsinventory front\ocsutils.cpp    18  
Warning    C4244    'initializing': conversion from 'ULONGLONG' to 'unsigned int', possible loss of data    OCSInventory Front    c:\users\ds\downloads\ocs-windows-agent\windowsagent\ocsinventory front\xmlinteract.cpp    963  
Warning    C4244    'initializing': conversion from 'ULONGLONG' to 'unsigned int', possible loss of data    OCSInventory Front    c:\users\ds\downloads\ocs-windows-agent\windowsagent\ocsinventory front\xmlinteract.cpp    965  
Warning    C4244    'argument': conversion from 'ULONGLONG' to 'DWORD', possible loss of data    OCSInventory Front    c:\users\ds\downloads\ocs-windows-agent\windowsagent\ocsinventory front\xmlinteract.cpp    971  
Warning    C4244    'argument': conversion from 'ULONGLONG' to 'DWORD', possible loss of data    OCSInventory Front    c:\users\ds\downloads\ocs-windows-agent\windowsagent\ocsinventory front\xmlinteract.cpp    989  
Error    C1083    Cannot open include file: 'openssl/aes.h': No such file or directory    ComHTTP    c:\users\ds\downloads\ocs-windows-agent\windowsagent\comhttp\httpcrypt.h    20  
Error    C1083    Cannot open include file: 'openssl/aes.h': No such file or directory    ComHTTP    c:\users\ds\downloads\ocs-windows-agent\windowsagent\comhttp\httpcrypt.h    20  
Error    C1083    Cannot open include file: 'openssl/aes.h': No such file or directory    ComHTTP    c:\users\ds\downloads\ocs-windows-agent\windowsagent\comhttp\httpcrypt.h    20  
Error    C1083    Cannot open include file: 'openssl/aes.h': No such file or directory    ComHTTP    c:\users\ds\downloads\ocs-windows-agent\windowsagent\comhttp\httpcrypt.h    20  
Error    LNK1181    cannot open input file 'C:\Users\ds\Downloads\ocs-windows-agent\WindowsAgent\Release\OCSInventory Front.lib'    Download    C:\Users\ds\Downloads\ocs-windows-agent\WindowsAgent\Download\LINK    1  
Warning    C4244    'initializing': conversion from 'time_t' to 'ULONG', possible loss of data    Agent    c:\users\ds\downloads\ocs-windows-agent\windowsagent\agent\capdownload.cpp    210  
Warning    C4244    'argument': conversion from 'time_t' to 'long', possible loss of data    Agent    c:\users\ds\downloads\ocs-windows-agent\windowsagent\agent\capdownload.cpp    559  
Error    C4839    non-standard use of class 'ATL::CA2WEX<128>' as an argument to a variadic function    Agent    c:\users\ds\downloads\ocs-windows-agent\windowsagent\agent\capexecute.cpp    110  
Error    C2248    'ATL::CA2WEX<128>::CA2WEX': cannot access private member declared in class 'ATL::CA2WEX<128>'    Agent    c:\users\ds\downloads\ocs-windows-agent\windowsagent\agent\capexecute.cpp    110  
Warning    C4996    'inet_addr': Use inet_pton() or InetPton() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings    Agent    c:\users\ds\downloads\ocs-windows-agent\windowsagent\agent\capipdiscover.cpp    68  
Can anybody help me to build the agent?

Regards

Daniel
asked in Agent for Windows development by (480 points)

1 Answer

0 votes

Ok, with using VS 2015 there are a lot of errors gone.

Bute now, I got the following errors:

1>------ Build started: Project: OCSInventory Front, Configuration: Release Win32 ------
1>  OcsUtils.cpp
1>OcsUtils.cpp(384): error C2079: 'ctx' uses undefined struct 'evp_md_ctx_st'
1>OcsUtils.cpp(393): error C2664: 'int EVP_DigestInit(EVP_MD_CTX *,const EVP_MD *)': cannot convert argument 1 from 'int *' to 'EVP_MD_CTX *'
1>  OcsUtils.cpp(393): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>OcsUtils.cpp(399): error C2664: 'int EVP_DigestUpdate(EVP_MD_CTX *,const void *,std::size_t)': cannot convert argument 1 from 'int *' to 'EVP_MD_CTX *'
1>  OcsUtils.cpp(399): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>OcsUtils.cpp(403): error C2664: 'int EVP_DigestFinal(EVP_MD_CTX *,unsigned char *,unsigned int *)': cannot convert argument 1 from 'int *' to 'EVP_MD_CTX *'
1>  OcsUtils.cpp(403): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>OcsUtils.cpp(419): warning C4477: 'swscanf' : format string '%c' requires an argument of type 'wchar_t *', but variadic argument 1 has type 'DWORD_PTR *'
1>OcsUtils.cpp(419): warning C4474: 'swscanf' : too many arguments passed for format string
1>  OcsUtils.cpp(419): note: placeholders and their parameters expect 1 variadic arguments, but 2 were provided
1>OcsUtils.cpp(447): warning C4477: 'swscanf' : format string '%2X' requires an argument of type 'unsigned int *', but variadic argument 1 has type 'BYTE *'
1>  OcsUtils.cpp(447): note: consider using '%hhX' in the format string
2>------ Build started: Project: ComHTTP, Configuration: Release Win32 ------
3>------ Build started: Project: Download, Configuration: Release Win32 ------
2>  HTTPCrypt.cpp
3>LINK : fatal error LNK1181: cannot open input file 'C:\Users\ds\Downloads\WindowsAgent-master\WindowsAgent-master\Release\OCSInventory Front.lib'
2>HTTPCrypt.cpp(124): error C2079: 'oEncCtx' uses undefined struct 'evp_cipher_ctx_st'
2>HTTPCrypt.cpp(156): error C2664: 'int EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *)': cannot convert argument 1 from 'int *' to 'EVP_CIPHER_CTX *'
2>  HTTPCrypt.cpp(156): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
2>HTTPCrypt.cpp(157): error C2664: 'int EVP_EncryptInit_ex(EVP_CIPHER_CTX *,const EVP_CIPHER *,ENGINE *,const unsigned char *,const unsigned char *)': cannot convert argument 1 from 'int *' to 'EVP_CIPHER_CTX *'
2>  HTTPCrypt.cpp(157): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
2>HTTPCrypt.cpp(174): error C2664: 'int EVP_EncryptUpdate(EVP_CIPHER_CTX *,unsigned char *,int *,const unsigned char *,int)': cannot convert argument 1 from 'int *' to 'EVP_CIPHER_CTX *'
2>  HTTPCrypt.cpp(174): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
2>HTTPCrypt.cpp(184): error C2664: 'int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *,unsigned char *,int *)': cannot convert argument 1 from 'int *' to 'EVP_CIPHER_CTX *'
2>  HTTPCrypt.cpp(184): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
2>HTTPCrypt.cpp(203): error C2664: 'int EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *)': cannot convert argument 1 from 'int *' to 'EVP_CIPHER_CTX *'
2>  HTTPCrypt.cpp(203): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
2>HTTPCrypt.cpp(209): error C2079: 'oEncCtx' uses undefined struct 'evp_cipher_ctx_st'
2>HTTPCrypt.cpp(242): error C2664: 'int EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *)': cannot convert argument 1 from 'int *' to 'EVP_CIPHER_CTX *'
2>  HTTPCrypt.cpp(242): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
2>HTTPCrypt.cpp(243): error C2664: 'int EVP_DecryptInit_ex(EVP_CIPHER_CTX *,const EVP_CIPHER *,ENGINE *,const unsigned char *,const unsigned char *)': cannot convert argument 1 from 'int *' to 'EVP_CIPHER_CTX *'
2>  HTTPCrypt.cpp(243): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
2>HTTPCrypt.cpp(260): error C2664: 'int EVP_DecryptUpdate(EVP_CIPHER_CTX *,unsigned char *,int *,const unsigned char *,int)': cannot convert argument 1 from 'int *' to 'EVP_CIPHER_CTX *'
2>  HTTPCrypt.cpp(260): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
2>HTTPCrypt.cpp(270): error C2664: 'int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *,unsigned char *,int *)': cannot convert argument 1 from 'int *' to 'EVP_CIPHER_CTX *'
2>  HTTPCrypt.cpp(270): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
2>HTTPCrypt.cpp(283): error C2664: 'int EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *)': cannot convert argument 1 from 'int *' to 'EVP_CIPHER_CTX *'
2>  HTTPCrypt.cpp(283): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
4>------ Build started: Project: Agent, Configuration: Release Win32 ------
4>LINK : fatal error LNK1181: cannot open input file 'C:\Users\ds\Downloads\WindowsAgent-master\WindowsAgent-master\Release\ComHTTP.lib'
========== Build: 0 succeeded, 4 failed, 2 up-to-date, 0 skipped ==========

Looks to me that the Agent can't be ever built with this source.

Unfortunately I don't have any clue about c++....

Is there a help anywhere?

answered ago by (480 points)
 
Powered by Question2Answer
...