Watch, Follow, &
Connect with Us

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


Welcome, Guest
Guest Settings
Help

Thread: Unresolved external '__fastcall System::Variant::Exec(...'


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Apr 13, 2018 9:30 PM Last Post By: Dimitry Ruhladev
Dean Clark

Posts: 50
Registered: 6/12/08
Unresolved external '__fastcall System::Variant::Exec(...'  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 4, 2018 9:03 AM
Still porting from classic compiler to Clang compiler, 32-bit, Builder 10.2.3. This is part of a routine that exports a data table to an Excel spreadsheet:
	PropertyGet getColumns("Columns");
	range = worksheet.Exec(getColumns);


Where range is a Variant. It compiles but fails to link with unresolved external message:
[ilink32 Error] Error: Unresolved external '__fastcall System::Variant::Exec(System::AutoCmd&, int) const' referenced from TIMEHISTORYTABLEFORM.OBJ

Perhaps there's a library that needs to be added to the project?

Thanks.
Dimitry Ruhladev

Posts: 1
Registered: 4/8/97
Re: Unresolved external '__fastcall System::Variant::Exec(...'  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 13, 2018 9:30 PM   in response to: Dean Clark in response to: Dean Clark
Dean Clark wrote:
Still porting from classic compiler to Clang compiler, 32-bit, Builder 10.2.3...

Same happened to me. After a lot of searching for correct library I looked at RTL sources and discovered that Variant::Exec() method is excluded from Clang version of RTL probably due to inline assembler usage. No word about it in documentation :(

The solution for me was replacing all calls to Variant::Exec() with calls to Variant::Ole###() methods. In your case it's going to be Variant::OlePropertyGet() method. A word of caution is that if you need to pass any OLE string parameters to that methods you must convert VCL strings to WideString, otherwise the call will end with "Bad parameter type" exception. Took me a long while to figure this out. The reason is that VCL AnsiString and UnicodeString have distinct variant types in Delphi Variant, which obviously are not recognized by Office applications.

Have fun porting!
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02