Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

SmartInspect with C++ Builder 10.2.3


#1

Hi there,
we’re in the process of evaluating SmartInspect for integration with our software developed using C++ Builder (currently we use 10.2.3, Enterprise version with all components installed).

We kindly need some help to get it working with this environment: we added all paths to the IDE options panel (for both classic and Clang compilers), but something goes wrong when building some kind of “hello world” code.

First case: VCL Form based 32 bit application.
We included the “Siauto.hpp” header on top of the form includes list and manually added the SmartInspectDXE10Seattle.lib to the project. We have 2 compile errors:
[bcc32 Error] SmartInspect.hpp(1207): E2015 Ambiguity between ‘Siwinsock2::TSockAddrIn’ and ‘Winapi::Winsock2::TSockAddrIn’
Full parser context
MainUnit1.cpp(6): #include C:\Program Files (x86)\Gurock Software\SmartInspect Professional\lib\delphi\delphiXE10Seattle\Siauto.hpp
Siauto.hpp(18): #include C:\Program Files (x86)\Gurock Software\SmartInspect Professional\lib\delphi\delphiXE10Seattle\SmartInspect.hpp
SmartInspect.hpp(35): namespace Smartinspect
SmartInspect.hpp(1194): class Smartinspect::TSiTcpClient
[bcc32 Error] SmartInspect.hpp(1208): E2015 Ambiguity between ‘Siwinsock2::PSockAddrIn’ and ‘Winapi::Winsock2::PSockAddrIn’
Full parser context
MainUnit1.cpp(6): #include C:\Program Files (x86)\Gurock Software\SmartInspect Professional\lib\delphi\delphiXE10Seattle\Siauto.hpp
Siauto.hpp(18): #include C:\Program Files (x86)\Gurock Software\SmartInspect Professional\lib\delphi\delphiXE10Seattle\SmartInspect.hpp
SmartInspect.hpp(35): namespace Smartinspect
SmartInspect.hpp(1194): class Smartinspect::TSiTcpClient

We moved this include in a separated file, a TThread descendant unit, which is someway closer to a tipical usage in our apps. This way we can successfully compile all code but the linker reports an error:
[ilink32 Error] Fatal: Unable to open file 'DATA.DB.OBJ'
This seems like IDE error because the only object file related to that include is “DATA.DB.dcu” which is correctly present in one of the “known” folders configured in the IDE options.

This comes from an include in the “SmartInspect.hpp” header, which includes #include <Data.DB.hpp>.

Second case: 32bit Windows Firemonkey Application project
By inlcuding Siauto.hpp the environment searches for VCL.GRAPHICS and VCL.IMAGING.JPEG packages which of course are not included in this configuration (Firemonkey).

Is there a way to fix these errors?
Thanks for any help,
Alex Bassi


#2

To anyone who can be interested in this topic.

After some tries, I decided to install C++ Builder 10X Seattle, which by the way is the latest IDE officially available in the lib\Delphi folder.

Nothing’s changed, so I though the issue was not in the IDE, or maybe both IDE had the same issue.

Compiler error number 1 (see my previous post) I decided to modify the Smartinspect.hpp header file by adding the required namespace to avoid conflicts. So all TSockAddrIn types used in two function members, became Siwinsock2::TSockAddrIn. This solved all compile issues.

Linker issues: I dropped a TClientDataSet component on a form. After cleaning and building the project, all linker errors went away and the system worked correctly.
So by the way, SmartInspect works as expected with C++ Builder 10 Seattle with just a little modification to one .hpp file.

Then, I went back to the 10.2.3 (Tokyo) installation and did the same and the linker error about “DATA.DB.obj” was gone.

Unfortunately another linker error came out:

[ilink32 Error] Error: Unresolved external ‘System::linkproc __fastcall LStrLen(System::AnsiStringT<0>)’ referenced from C:\PROGRAM FILES (X86)\GUROCK SOFTWARE\SMARTINSPECT PROFESSIONAL\LIB\DELPHI\DELPHIXE10SEATTLE\SMARTINSPECTDXE10SEATTLE.LIB|SmartInspect

I will investigate this one also, but I think that the fix could be recompiling the Delphi original package using 10.2.3 version, and this is where I hope someone at Gurock will come in to help me.

Thanks,
Alex