Jump to content
dmitrybv

How to properly configure Delphi packages so that components from these packages can be used in C++ Builder projects.

Recommended Posts

Hello.


Embarcadero® RAD Studio 12 Version 29.0.53982.0329


I have a Delphi package with components. And I use them to create Delphi projects without any problems.
Now I need to use these components in a C++ Builder project.

 

In the

Project Options-Building-Delphi Compiler-Output – C/C++ package settings, I set the Generate all C++Builder files (including package libs) option.


When compiling the package, *.hpp files were created based on the pas files of the package.


Now I create a C++ Builder project, drop my components on the form and try to compile the project.


As a result, I get the following errors:

 

C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.Types.hpp(64,13): error E4689: 'Controls' is not a class, namespace, or enumeration
c:\radstudio\23.0\include\windows\fmx\FMX.Controls.Presentation.hpp(34,10): error E6300: 'Controls' declared here


on line

typedef Fmx::Controls::TControl TWinControl;


I can't figure out what the error is.

 

Visually, the code section contains the correct text.


The FMX.Controls.hpp file contains nested namespaces
 

namespace Fmx
{
namespace Controls
{


And the text Fmx::Controls::… is a valid reference to a type in the nested namespace

namespace Fmx { namespace Controls {

 

 

image.thumb.png.b2b25e0e124f937fd0a76098e26b7321.png

 

 

image.thumb.png.6aaf438cc8021fe789a63a60ee6e298c.png

 

 

 

Project "C:\RADStudio\23.0\EhLib.12_0-Dev\Demos\Fmx\CPPBuilderApps\TestCPPBuilderApp\Project1.cbproj" (Build target(s)):
Target MakeObjs:
    Target CppCompile:
        Target _CppCoreCompile:
            Target _CLANGCoreCompile:
                c:\radstudio\23.0\bin\bcc32c.exe -cc1 -D _DEBUG -D FRAMEWORK_FMX -D USEPACKAGES -output-dir .\Win32\Debug -I C:\RADStudio\23.0\EhLib.12_0-Dev\Demos\Fmx\CPPBuilderApps\TestCPPBuilderApp -I c:\radstudio\23.0\include\windows\fmx -I c:\radstudio\23.0\EhLib.12_0-Dev\Demos\Fmx\CPPBuilderApps\TestCPPBuilderApp -isystem c:\radstudio\23.0\include -isystem c:\radstudio\23.0\include\dinkumware64 -isystem c:\radstudio\23.0\include\windows\crtl -isystem c:\radstudio\23.0\include\windows\sdk -isystem c:\radstudio\23.0\include\windows\rtl -isystem c:\radstudio\23.0\include\windows\vcl -isystem c:\radstudio\23.0\include\windows\fmx -isystem C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32 -isystem C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32 -debug-info-kind=standalone -fcxx-exceptions -fborland-extensions -nobuiltininc -nostdsysteminc -triple i686-pc-windows-omf -emit-pch -mrelocation-model static -masm-verbose -ffunction-sections -fexceptions -fseh -mstack-alignment=16 -fno-spell-checking -fno-use-cxa-atexit -fno-threadsafe-statics -x c++ -std=c++17 -O0 -fmath-errno -tR -tM -tU -tW -o .\Win32\Debug\Project1PCH1.pch --auto-dependency-output Project1PCH1.h 
            Target _CLANGCoreCompile:
                c:\radstudio\23.0\bin\bcc32c.exe -cc1 -D _DEBUG -D FRAMEWORK_FMX -D USEPACKAGES -output-dir .\Win32\Debug -I C:\RADStudio\23.0\EhLib.12_0-Dev\Demos\Fmx\CPPBuilderApps\TestCPPBuilderApp -I c:\radstudio\23.0\include\windows\fmx -I c:\radstudio\23.0\EhLib.12_0-Dev\Demos\Fmx\CPPBuilderApps\TestCPPBuilderApp -isystem c:\radstudio\23.0\include -isystem c:\radstudio\23.0\include\dinkumware64 -isystem c:\radstudio\23.0\include\windows\crtl -isystem c:\radstudio\23.0\include\windows\sdk -isystem c:\radstudio\23.0\include\windows\rtl -isystem c:\radstudio\23.0\include\windows\vcl -isystem c:\radstudio\23.0\include\windows\fmx -isystem C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32 -isystem C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32 -debug-info-kind=standalone -fcxx-exceptions -fborland-extensions -nobuiltininc -nostdsysteminc -triple i686-pc-windows-omf -emit-obj -mrelocation-model static -masm-verbose -ffunction-sections -fexceptions -fseh -mstack-alignment=16 -fno-spell-checking -fno-use-cxa-atexit -fno-threadsafe-statics -main-file-name Project1.cpp -x c++ -std=c++17 -O0 -fmath-errno -tR -tM -tU -tW -o .\Win32\Debug\Project1.obj --auto-dependency-output -MT .\Win32\Debug\Project1.obj -include-pch .\Win32\Debug\Project1PCH1.pch Project1.cpp 
            Target _CLANGCoreCompile:
                c:\radstudio\23.0\bin\bcc32c.exe -cc1 -D _DEBUG -D FRAMEWORK_FMX -D USEPACKAGES -output-dir .\Win32\Debug -I C:\RADStudio\23.0\EhLib.12_0-Dev\Demos\Fmx\CPPBuilderApps\TestCPPBuilderApp -I c:\radstudio\23.0\include\windows\fmx -I c:\radstudio\23.0\EhLib.12_0-Dev\Demos\Fmx\CPPBuilderApps\TestCPPBuilderApp -isystem c:\radstudio\23.0\include -isystem c:\radstudio\23.0\include\dinkumware64 -isystem c:\radstudio\23.0\include\windows\crtl -isystem c:\radstudio\23.0\include\windows\sdk -isystem c:\radstudio\23.0\include\windows\rtl -isystem c:\radstudio\23.0\include\windows\vcl -isystem c:\radstudio\23.0\include\windows\fmx -isystem C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32 -isystem C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32 -debug-info-kind=standalone -fcxx-exceptions -fborland-extensions -nobuiltininc -nostdsysteminc -triple i686-pc-windows-omf -emit-obj -mrelocation-model static -masm-verbose -ffunction-sections -fexceptions -fseh -mstack-alignment=16 -fno-spell-checking -fno-use-cxa-atexit -fno-threadsafe-statics -main-file-name Unit1.cpp -x c++ -std=c++17 -O0 -fmath-errno -tR -tM -tU -tW -o .\Win32\Debug\Unit1.obj --auto-dependency-output -MT .\Win32\Debug\Unit1.obj -include-pch .\Win32\Debug\Project1PCH1.pch Unit1.cpp 
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.Types.hpp(64,13): error E4689: 'Controls' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Controls.Presentation.hpp(34,10): error E6300: 'Controls' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.GridAxisData.hpp(47,6): error E4689: 'Controls' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Controls.Presentation.hpp(34,10): error E6300: 'Controls' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.GridAxisData.hpp(102,33): error E4689: 'Controls' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Controls.Presentation.hpp(34,10): error E6300: 'Controls' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.Platform.hpp(68,59): error E4689: 'Forms' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Forms.hpp(48,10): error E6300: 'Forms' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ImageReses.hpp(57,6): error E4689: 'Graphics' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Graphics.hpp(34,10): error E6300: 'Graphics' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ImageReses.hpp(65,43): error E4689: 'Graphics' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Graphics.hpp(34,10): error E6300: 'Graphics' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ImageReses.hpp(65,79): error E4689: 'Graphics' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Graphics.hpp(34,10): error E6300: 'Graphics' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ImageReses.hpp(66,14): error E4689: 'Graphics' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Graphics.hpp(34,10): error E6300: 'Graphics' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ImageReses.hpp(67,14): error E4689: 'Graphics' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Graphics.hpp(34,10): error E6300: 'Graphics' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ImageReses.hpp(98,74): error E4689: 'Graphics' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Graphics.hpp(34,10): error E6300: 'Graphics' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ImageReses.hpp(98,92): error E2595: expected expression
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ImageReses.hpp(99,6): error E4689: 'Imglist' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.ImgList.hpp(36,10): error E6300: 'Imglist' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ImageReses.hpp(101,6): error E4689: 'Multiresbitmap' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.MultiResBitmap.hpp(31,10): error E6300: 'Multiresbitmap' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ImageReses.hpp(102,6): error E4689: 'Multiresbitmap' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.MultiResBitmap.hpp(31,10): error E6300: 'Multiresbitmap' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ImageReses.hpp(103,6): error E4689: 'Multiresbitmap' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.MultiResBitmap.hpp(31,10): error E6300: 'Multiresbitmap' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ImageReses.hpp(104,6): error E4689: 'Multiresbitmap' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.MultiResBitmap.hpp(31,10): error E6300: 'Multiresbitmap' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ImageReses.hpp(105,6): error E4689: 'Multiresbitmap' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.MultiResBitmap.hpp(31,10): error E6300: 'Multiresbitmap' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ImageReses.hpp(106,6): error E4689: 'Multiresbitmap' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.MultiResBitmap.hpp(31,10): error E6300: 'Multiresbitmap' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ImageReses.hpp(107,6): error E4689: 'Multiresbitmap' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.MultiResBitmap.hpp(31,10): error E6300: 'Multiresbitmap' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ImageReses.hpp(108,6): error E4689: 'Graphics' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Graphics.hpp(34,10): error E6300: 'Graphics' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ImageReses.hpp(109,6): error E4689: 'Graphics' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Graphics.hpp(34,10): error E6300: 'Graphics' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ImageReses.hpp(156,17): error E4689: 'Graphics' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Graphics.hpp(34,10): error E6300: 'Graphics' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ImageReses.hpp(157,17): error E4689: 'Imglist' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.ImgList.hpp(36,10): error E6300: 'Imglist' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ImageReses.hpp(158,17): error E4689: 'Multiresbitmap' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.MultiResBitmap.hpp(31,10): error E6300: 'Multiresbitmap' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ImageReses.hpp(159,17): error E4689: 'Multiresbitmap' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.MultiResBitmap.hpp(31,10): error E6300: 'Multiresbitmap' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ImageReses.hpp(160,17): error E4689: 'Multiresbitmap' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.MultiResBitmap.hpp(31,10): error E6300: 'Multiresbitmap' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ImageReses.hpp(161,17): error E4689: 'Multiresbitmap' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.MultiResBitmap.hpp(31,10): error E6300: 'Multiresbitmap' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ImageReses.hpp(162,17): error E4689: 'Multiresbitmap' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.MultiResBitmap.hpp(31,10): error E6300: 'Multiresbitmap' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ImageReses.hpp(163,17): error E4689: 'Multiresbitmap' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.MultiResBitmap.hpp(31,10): error E6300: 'Multiresbitmap' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ImageReses.hpp(164,17): error E4689: 'Multiresbitmap' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.MultiResBitmap.hpp(31,10): error E6300: 'Multiresbitmap' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ToolControls.hpp(94,70): error E4689: 'Forms' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Forms.hpp(48,10): error E6300: 'Forms' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ToolControls.hpp(98,44): error E5873: no type named 'TFmxObject' in namespace 'Ehlib::Fmx::Types'
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ToolControls.hpp(107,38): error E4689: 'Controls' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Controls.Presentation.hpp(34,10): error E6300: 'Controls' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ToolControls.hpp(107,83): error E4689: 'Controls' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Controls.Presentation.hpp(34,10): error E6300: 'Controls' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ToolControls.hpp(109,45): error E4689: 'Controls' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Controls.Presentation.hpp(34,10): error E6300: 'Controls' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ToolControls.hpp(109,130): error E4689: 'Controls' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Controls.Presentation.hpp(34,10): error E6300: 'Controls' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ToolControls.hpp(121,6): error E4689: 'Graphics' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Graphics.hpp(34,10): error E6300: 'Graphics' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ToolControls.hpp(124,6): error E4689: 'Graphics' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Graphics.hpp(34,10): error E6300: 'Graphics' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ToolControls.hpp(125,49): error E5873: no type named '_di_IFreeNotification' in namespace 'Ehlib::Fmx::Types'
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ToolControls.hpp(126,52): error E5873: no type named '_di_IFreeNotification' in namespace 'Ehlib::Fmx::Types'
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ToolControls.hpp(131,17): error E4689: 'Graphics' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Graphics.hpp(34,10): error E6300: 'Graphics' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ToolControls.hpp(138,15): error E4689: 'Graphics' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Graphics.hpp(34,10): error E6300: 'Graphics' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ToolControls.hpp(152,49): error E4689: 'Forms' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Forms.hpp(48,10): error E6300: 'Forms' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ToolControls.hpp(152,56): error E2587: expected class name
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ToolControls.hpp(154,14): error E4689: 'Forms' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Forms.hpp(48,10): error E6300: 'Forms' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ToolControls.hpp(157,13): error E5873: no type named 'TFmxObject' in namespace 'Ehlib::Fmx::Types'
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ToolControls.hpp(158,54): error E5873: no type named 'TFmxObject' in namespace 'Ehlib::Fmx::Types'
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ToolControls.hpp(159,49): error E4689: 'Graphics' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Graphics.hpp(34,10): error E6300: 'Graphics' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ToolControls.hpp(160,36): error E4689: 'Forms' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Forms.hpp(48,10): error E6300: 'Forms' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ToolControls.hpp(163,6): error E4689: 'Forms' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Forms.hpp(48,10): error E6300: 'Forms' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ToolControls.hpp(164,38): error E4689: 'Graphics' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Graphics.hpp(34,10): error E6300: 'Graphics' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ToolControls.hpp(170,24): error E5873: no type named 'TFmxObject' in namespace 'Ehlib::Fmx::Types'
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ToolControls.hpp(171,17): error E4689: 'Forms' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Forms.hpp(48,10): error E6300: 'Forms' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ToolControls.hpp(173,132): error E4689: 'Forms' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Forms.hpp(48,10): error E6300: 'Forms' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ToolControls.hpp(173,139): error E4987: member initializer 'TForm' does not name a non-static data member or base class
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ToolControls.hpp(184,6): error E4689: 'Controls' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Controls.Presentation.hpp(34,10): error E6300: 'Controls' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ToolControls.hpp(187,27): error E4689: 'Controls' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Controls.Presentation.hpp(34,10): error E6300: 'Controls' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ToolControls.hpp(188,17): error E4689: 'Controls' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Controls.Presentation.hpp(34,10): error E6300: 'Controls' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ToolControls.hpp(208,6): error E4689: 'Controls' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Controls.Presentation.hpp(34,10): error E6300: 'Controls' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ToolControls.hpp(212,84): error E4689: 'Controls' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Controls.Presentation.hpp(34,10): error E6300: 'Controls' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ToolControls.hpp(216,17): error E4689: 'Controls' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Controls.Presentation.hpp(34,10): error E6300: 'Controls' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ToolControls.hpp(218,62): error E4689: 'Controls' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Controls.Presentation.hpp(34,10): error E6300: 'Controls' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ToolControls.hpp(238,133): error E4689: 'Controls' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Controls.Presentation.hpp(34,10): error E6300: 'Controls' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ToolControls.hpp(257,6): error E4689: 'Controls' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Controls.Presentation.hpp(34,10): error E6300: 'Controls' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ToolControls.hpp(261,74): error E4689: 'Controls' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Controls.Presentation.hpp(34,10): error E6300: 'Controls' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ToolControls.hpp(263,17): error E4689: 'Controls' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Controls.Presentation.hpp(34,10): error E6300: 'Controls' declared here
                C:\Users\Public\Documents\Embarcadero\Studio\23.0\hpp\Win32\EhLib.Fmx.ToolControls.hpp(275,52): error E4689: 'Controls' is not a class, namespace, or enumeration
                c:\radstudio\23.0\include\windows\fmx\FMX.Controls.Presentation.hpp(34,10): error E6300: 'Controls' declared here

 

Share this post


Link to post

Does EhLib.Fmx.Types.pas have the FMX.Controls unit in its 'interface' uses clause? Does the generated EhLib.Fmx.Type.hpp file have an #include <FMX.Controls.hpp> statement? 

Share this post


Link to post
Quote

Does EhLib.Fmx.Types.pas have the FMX.Controls unit in its 'interface' uses clause?

Yes, it have.

 

Quote

Does the generated EhLib.Fmx.Type.hpp file have an #include <FMX.Controls.hpp> statement? 

Yes, it have.

 

image.thumb.png.aa6d44327244d4c16f8b8e18ce4f2ab4.png

 

Edited by dmitrybv

Share this post


Link to post

By default, Pascal-generated HPP headers bring their C++ namespaces into the namespace that is #include'ing the HPP file (which is usually the global scope).  So, in this case, there are two Fmx namespaces in the same scope, and the compiler ends up picking your namespace instead of FireMonkey's, which is why it can't find the Fmx::Controls namespace.

 

If you look at your HPP files, you will notice that there are 'using namespace' statements at the bottom which are wrapped in preprocessor blocks, eg:

#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_EHLIB_FMX_TYPE)
using namespace EhLib.Fmx.Type;
#endif
#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_EHLIB_FMX)
using namespace EhLib.Fmx;
#endif
#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_EHLIB)
using namespace EhLib;
#endif

To avoid this ambiguity, you can specify either DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE or the desired NO_USING_NAMESPACE_... conditional(s) in the "Conditional defines" section of your C++ project's settings.  Or, at least, simply #define them above the relevant #include statement(s) in your C++ code.  Alternatively, another workaround would be to add {$HPPEMIT NOUSINGNAMESPACE} to your Pascal units to avoid any 'using namespace' statements in their generated HPP files.

Edited by Remy Lebeau

Share this post


Link to post

Is it possible to avoid such problems by simply naming pas modules "correctly"?
So far I understand that you can't use the string ".Vcl." and ".Fmx." in module names.
Are there any specific rules on how to correctly insert dots into package module names?
After all, when creating the namespaces structure based on the pas module name, the developers of Delphi and C++ Builder modeled how developers of new packages would integrate into the current tree of nested namespaces.

Share this post


Link to post
16 hours ago, dmitrybv said:

So far I understand that you can't use the string ".Vcl." and ".Fmx." in module names.

Yes, you can. And it works perfectly fine on the Delphi side. It is only on the C++ side that you may run into trouble, and I already explained how to work around that.

Quote

Are there any specific rules on how to correctly insert dots into package module names?

The issue is not about the dots themselves, but with the names you put in between the dots. It is your responsibility to make sure those names don't conflict. And instruct the C++ compiler how to handle them correctly if needed. 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×