2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

C++ Builder 10.2 Tokyo > [ilink32 エラー] Error: 未解決の外部シンボル '__fastcall Vcl::Filectrl::SelectDirectory(System::UnicodeString, System::WideString, System::UnicodeString&, ...)' が... > 対処: #include <Vcl.FileCtrl.hpp>にする

Posted at
動作環境
RAD Studio 10.2 Tokyo Update 3 
Windows 10 v1903 

参考

情報感謝です。

実装とエラー

Unit1.cpp
//---------------------------------------------------------------------------

# include <vcl.h>
# pragma hdrstop

# include <FileCtrl.hpp>
# include "Unit1.h"
//---------------------------------------------------------------------------
# pragma package(smart_init)
# pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
	//

	String dir;

	if (SelectDirectory(L"フォルダを指定して下さい。", L"", dir))
	{
	  //フォルダを選択して[OK]ボタンが押されたとき
	  MessageDlg(dir + L"が選択されました。", mtInformation, TMsgDlgButtons() << mbOK, 0);
	}
}
//---------------------------------------------------------------------------

ビルドすると、下記のエラーとなる。

[ilink32 エラー] Error: 未解決の外部シンボル '__fastcall Vcl::Filectrl::SelectDirectory(System::UnicodeString, System::WideString, System::UnicodeString&, System::Set, Vcl::Controls::TWinControl *)' が XXX\UNIT1.OBJ から参照されています

対処

#include <FileCtrl.hpp>

#include <Vcl.FileCtrl.hpp>
に変更する。

XE4から10.2 Tokyoへの移行などで同様のエラーが発生するようになる。

Web上の情報でIDEのバージョンが古い場合、同様の対処をすると解決するかもしれない。

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?