Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: VCL components with CLANG-32



Permlink Replies: 6 - Last Post: Sep 20, 2015 8:56 AM Last Post By: Petr Vykouk
Martin van der ...

Posts: 57
Registered: 7/14/02
VCL components with CLANG-32
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 1, 2015 6:03 AM
Hello.

I'm having some trouble getting custom VCL components to work using the CLANG-32 compiler. Let me post a simple example to illustrate...

First, I create a new VCL forms project. In the options, I turn the classic compiler OFF.
Then, I create 2 new units. In these units, I defined a simple custom VCL class like so:

class TTestPanel : public TCustomPanel
{
__published:
__property OnClick;
public:
__fastcall TTestPanel(Classes::TComponent* Owner);
virtual __fastcall ~TTestPanel(void);
};

With empty constructor and destructor in the .cpp:

__fastcall TTestPanel::TTestPanel(Classes::TComponent* Owner)
: TCustomPanel(Owner)
{
}

__fastcall TTestPanel::~TTestPanel(void)
{
}

In the second unit I added, I named it "TTestPanel2", but the contents are the same.

Now, if I build this, I get the following linker warnings:

[ilink32 Warning] Warning: Public symbol '__tpdsc__ void' defined in both module C:\...\UNIT4.OBJ and C:\...\UNIT5.OBJ
[ilink32 Warning] Warning: Public symbol '_methsig' defined in both module C:\...\UNIT4.OBJ and C:\...\UNIT5.OBJ

These are triggered by the OnClick property I added to both classes. Without it, there are no warnings. When using larger classes with many properties, many more such warnings appear.
It compiles and links fine with the classic compiler. There are also no warnings if I use the 64-bit compiler.

I'm also unable to successfully create a .bpl package with components using the CLANG-32 compiler. Besides the linker warnings from before, the Register function also doesn't get exported so the components don't get installed into the IDE. Using the classic compiler, it builds and installs, but then it won't link to projects using the CLANG compiler.

Any pointers?
Max Renker

Posts: 7
Registered: 10/9/14
Re: VCL components with CLANG-32
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 1, 2015 9:15 AM   in response to: Martin van der ... in response to: Martin van der ...
According to the Release Notes (http://docwiki.embarcadero.com/RADStudio/Seattle/en/IDE_Reference_and_Utilities):

"When building a package that contains a component you want the IDE to use, you may need to set additional options for the Clang32 compiler. Under Project > Options > C++ Linker, please add -tP under additional Options."

Perhaps this will help you.
Martin van der ...

Posts: 57
Registered: 7/14/02
Re: VCL components with CLANG-32
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 1, 2015 11:25 PM   in response to: Max Renker in response to: Max Renker
Max Renker wrote:
According to the Release Notes (http://docwiki.embarcadero.com/RADStudio/Seattle/en/IDE_Reference_and_Utilities):

"When building a package that contains a component you want the IDE to use, you may need to set additional options for the Clang32 compiler. Under Project > Options > C++ Linker, please add -tP under additional Options."

Perhaps this will help you.

Hi, thanks for your response. Unfortunately it doesn't make a difference.
Arkady Semylio

Posts: 87
Registered: 9/18/15
Re: VCL components with CLANG-32
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 14, 2015 3:12 AM   in response to: Max Renker in response to: Max Renker
Max Renker wrote:
According to the Release Notes (http://docwiki.embarcadero.com/RADStudio/Seattle/en/IDE_Reference_and_Utilities):

"When building a package that contains a component you want the IDE to use, you may need to set additional options for the Clang32 compiler. Under Project > Options > C++ Linker, please add -tP under additional Options."

Perhaps this will help you.

Hi,

Not C++ linker, C++ compiler.

Under Project > Options > C++ Compiler > Advanced > "Other options" > "Additional options to pass to the compiler", please add -tP in this field.

See: http://docwiki.embarcadero.com/RADStudio/Seattle/en/Release_Notes#Additional_Options_for_BCC32C_to_Generate_a_Package

Byte

Edited by: Arkady Semylio on Sep 14, 2015 3:14 AM
Martin van der ...

Posts: 57
Registered: 7/14/02
Re: VCL components with CLANG-32
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 14, 2015 11:50 PM   in response to: Arkady Semylio in response to: Arkady Semylio
Arkady Semylio wrote:
Hi,

Not C++ linker, C++ compiler.

Under Project > Options > C++ Compiler > Advanced > "Other options" > "Additional options to pass to the compiler", please add -tP in this field.

See: http://docwiki.embarcadero.com/RADStudio/Seattle/en/Release_Notes#Additional_Options_for_BCC32C_to_Generate_a_Package

Byte

Edited by: Arkady Semylio on Sep 14, 2015 3:14 AM

Hi,

thanks for your suggestion, but unfortunately it doesn't help. If I use -tP on the compiler when building my .bpl, I get all sorts of linker errors (unresolved externals from the standard C++ library) in addition to the warnings I already got.
Arkady Semylio

Posts: 87
Registered: 9/18/15
Re: VCL components with CLANG-32
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 15, 2015 3:31 AM   in response to: Martin van der ... in response to: Martin van der ...
Martin van der Plas wrote:
Arkady Semylio wrote:
Not C++ linker, C++ compiler.

Under Project > Options > C++ Compiler > Advanced > "Other options" > "Additional options to pass to the compiler", please add -tP in this field.

See: http://docwiki.embarcadero.com/RADStudio/Seattle/en/Release_Notes#Additional_Options_for_BCC32C_to_Generate_a_Package
Hi,

thanks for your suggestion, but unfortunately it doesn't help. If I use -tP on the compiler when building my .bpl, I get all sorts of linker errors (unresolved externals from the standard C++ library) in addition to the warnings I already got.

Hi,

many, if not all, unresolved externals errors to std lib, could disappear recreating the project from scratch.

I've been able to compile a component using BCC32C and the -tP switch built in a single package (design and release features in the same package).

However I'm not be able to compile a component splitted in designtime and runtime packages with the designtime package obviously linked to the runtime package. I get some linker errors in the designtime package to the component defined in the runtime package.

A solution I've found is to create another buil configuration for the runtime package for new BCC32C compiler then save the bpi/lib and bpl in specific subfolders (using "BPI/LIB output" and "Final output directory" fields in project options for the runtime component package).

Then , in the application using the component compiled wint BCC32C, add the path of BPI/LIB as the first item in the library search path.

HTH

Bye
Petr Vykouk

Posts: 42
Registered: 6/4/00
Re: VCL components with CLANG-32
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 20, 2015 8:56 AM   in response to: Arkady Semylio in response to: Arkady Semylio
Arkady Semylio wrote:
Martin van der Plas wrote:
Arkady Semylio wrote:
Not C++ linker, C++ compiler.

Under Project > Options > C++ Compiler > Advanced > "Other options" > "Additional options to pass to the compiler", please add -tP in this field.

See: http://docwiki.embarcadero.com/RADStudio/Seattle/en/Release_Notes#Additional_Options_for_BCC32C_to_Generate_a_Package
Hi,

thanks for your suggestion, but unfortunately it doesn't help. If I use -tP on the compiler when building my .bpl, I get all sorts of linker errors (unresolved externals from the standard C++ library) in addition to the warnings I already got.

Hi,

many, if not all, unresolved externals errors to std lib, could disappear recreating the project from scratch.

I've been able to compile a component using BCC32C and the -tP switch built in a single package (design and release features in the same package).

However I'm not be able to compile a component splitted in designtime and runtime packages with the designtime package obviously linked to the runtime package. I get some linker errors in the designtime package to the component defined in the runtime package.

A solution I've found is to create another buil configuration for the runtime package for new BCC32C compiler then save the bpi/lib and bpl in specific subfolders (using "BPI/LIB output" and "Final output directory" fields in project options for the runtime component package).

Then , in the application using the component compiled wint BCC32C, add the path of BPI/LIB as the first item in the library search path.

HTH

Bye

Many maybe yes, but unfortunatelly, not ALL!
CX10 is at this point of evolution very erroneous product.

P.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02