现在Delphi的版本更新速度太快基本上一年一个版本,但有些花钱买的老控件想安装到最新的Delphi上因为里面的版本宏没定义导致安装失败,解决方法就是自己去宏定义里面加一个当前版本的Delphi版本宏就可以正常安装。
如果自己查看当前最新的Delphi的编译版本号和版本宏呢?
我前版本是Delphi 11.1
编译版本号CompilerVersion:
这个在Delphi里其实定义的是一个常量用一句代码就能得得到
ShowMessage(FloatToStr(CompilerVersion));//35
版本宏VERXXX:
到安装目录中找到这个文件里面有定义
D:\Program Files (x86)\Embarcadero\Studio\22.0\source\Indy10\System\IdCompilerDefines.inc
// Delphi 4
{$IFDEF VER120}
{$DEFINE DCC}
{$DEFINE VCL_40}
{$DEFINE DELPHI_4}
{$ENDIF}
// C++Builder 4
{$IFDEF VER125}
{$DEFINE DCC}
{$DEFINE VCL_40}
{$DEFINE CBUILDER_4}
{$ENDIF}
// Delphi & C++Builder 5
{$IFDEF VER130}
{$DEFINE DCC}
{$DEFINE VCL_50}
{$IFDEF CBUILDER}
{$DEFINE CBUILDER_5}
{$ELSE}
{$DEFINE DELPHI_5}
{$ENDIF}
{$ENDIF}
//Delphi & C++Builder 6
{$IFDEF VER140}
{$DEFINE DCC}
{$DEFINE VCL_60}
{$IFDEF CBUILDER}
{$DEFINE CBUILDER_6}
{$ELSE}
{$DEFINE DELPHI_6}
{$ENDIF}
{$ENDIF}
//Delphi 7
{$IFDEF VER150}
{$DEFINE DCC}
{$DEFINE VCL_70}
{$DEFINE DELPHI_7} // there was no C++ Builder 7
{$ENDIF}
//Delphi 8
{$IFDEF VER160}
{$DEFINE DCC}
{$DEFINE VCL_80}
{$DEFINE DELPHI_8} // there was no C++ Builder 8
{$ENDIF}
//Delphi 2005
{$IFDEF VER170}
{$DEFINE DCC}
{$DEFINE VCL_2005}
{$DEFINE DELPHI_2005} // there was no C++Builder 2005
{$ENDIF}
// NOTE: CodeGear decided to make Highlander be a non-breaking release
// (no interface changes, thus fully backwards compatible without any
// end user code changes), so VER180 applies to both BDS 2006 and
// Highlander prior to the release of RAD Studio 2007. Use VER185 to
// identify Highlanger specifically.
//Delphi & C++Builder 2006
//Delphi & C++Builder 2007 (Highlander)
{$IFDEF VER180}
{$DEFINE DCC}
{$DEFINE VCL_2006}
{$IFDEF CBUILDER}
{$DEFINE CBUILDER_2006}
{$ELSE}
{$DEFINE DELPHI_2006}
{$ENDIF}
{$ENDIF}
//Delphi & C++Builder 2007 (Highlander)
{$IFDEF VER185}
{$DEFINE DCC}
{$UNDEF VCL_2006}
{$DEFINE VCL_2007}
{$IFDEF CBUILDER}
{$UNDEF CBUILDER_2006}
{$DEFINE CBUILDER_2007}
{$ELSE}
{$UNDEF DELPHI_2006}
{$DEFINE DELPHI_2007}
{$ENDIF}
{$ENDIF}
// BDS 2007 NET personality uses VER190 instead of 185.
//Delphi .NET 2007
{$IFDEF VER190}
{$DEFINE DCC}
{$IFDEF CIL}
//Delphi 2007
{$DEFINE VCL_2007}
{$DEFINE DELPHI_2007}
{$ENDIF}
{$ENDIF}
//Delphi & C++Builder 2009 (Tiburon)
{$IFDEF VER200}
{$DEFINE DCC}
{$DEFINE VCL_2009}
{$IFDEF CBUILDER}
{$DEFINE CBUILDER_2009}
{$ELSE}
{$DEFINE DELPHI_2009}
{$ENDIF}
{$ENDIF}
//Delphi & C++Builder 2010 (Weaver)
{$IFDEF VER210}
{$DEFINE DCC}
{$DEFINE VCL_2010}
{$IFDEF CBUILDER}
{$DEFINE CBUILDER_2010}
{$ELSE}
{$DEFINE DELPHI_2010}
{$ENDIF}
{$ENDIF}
//Delphi & C++Builder XE (Fulcrum)
{$IFDEF VER220}
//REMOVE DCC DEFINE after the next Fulcrum beta.
//It will be defined there.
{$IFNDEF DCC}
{$DEFINE DCC}
{$ENDIF}
{$DEFINE VCL_XE}
{$IFDEF CBUILDER}
{$DEFINE CBUILDER_XE}
{$ELSE}
{$DEFINE DELPHI_XE}
{$ENDIF}
{$ENDIF}
// DCC is now defined by the Delphi compiler starting in XE2
//Delphi & CBuilder XE2 (Pulsar)
{$IFDEF VER230}
{$DEFINE VCL_XE2}
{$IFDEF CBUILDER}
{$DEFINE CBUILDER_XE2}
{$ELSE}
{$DEFINE DELPHI_XE2}
{$ENDIF}
{$ENDIF}
//Delphi & CBuilder XE3 (Waterdragon)
//Delphi & CBuilder XE3.5 (Quintessence - early betas only)
{$IFDEF VER240}
{$DEFINE VCL_XE3}
{$IFDEF CBUILDER}
{$DEFINE CBUILDER_XE3}
{$ELSE}
{$DEFINE DELPHI_XE3}
{$ENDIF}
{$ENDIF}
//Delphi & CBuilder XE4 (Quintessence)
{$IFDEF VER250}
{$UNDEF VCL_XE3}
{$DEFINE VCL_XE4}
{$IFDEF CBUILDER}
{$UNDEF CBUILDER_XE3}
{$DEFINE CBUILDER_XE4}
{$ELSE}
{$UNDEF DELPHI_XE3}
{$DEFINE DELPHI_XE4}
{$ENDIF}
{$ENDIF}
//Delphi & CBuilder XE5 (Zephyr)
{$IFDEF VER260}
{$DEFINE VCL_XE5}
{$IFDEF CBUILDER}
{$DEFINE CBUILDER_XE5}
{$ELSE}
{$DEFINE DELPHI_XE5}
{$ENDIF}
{$ENDIF}
//Delphi & CBuilder AppMethod
//AppMethod is just XE5 for mobile only, VCL is removed
{$IFDEF VER265}
{$DEFINE VCL_XE5}
{$IFDEF CBUILDER}
{$DEFINE CBUILDER_XE5}
{$ELSE}
{$DEFINE DELPHI_XE5}
{$ENDIF}
{$ENDIF}
//Delphi & CBuilder XE6 (Proteus)
{$IFDEF VER270}
{$DEFINE VCL_XE6}
{$IFDEF CBUILDER}
{$DEFINE CBUILDER_XE6}
{$ELSE}
{$DEFINE DELPHI_XE6}
{$ENDIF}
{$ENDIF}
//Delphi & CBuilder XE7 (Carpathia)
{$IFDEF VER280}
{$DEFINE VCL_XE7}
{$IFDEF CBUILDER}
{$DEFINE CBUILDER_XE7}
{$ELSE}
{$DEFINE DELPHI_XE7}
{$ENDIF}
{$ENDIF}
//Delphi & CBuilder XE8 (Elbrus)
{$IFDEF VER290}
{$DEFINE VCL_XE8}
{$IFDEF CBUILDER}
{$DEFINE CBUILDER_XE8}
{$ELSE}
{$DEFINE DELPHI_XE8}
{$ENDIF}
{$ENDIF}
//Delphi & CBuilder 10.0 Seattle (Aitana)
{$IFDEF VER300}
{$DEFINE VCL_10_0_SEATTLE}
{$IFDEF CBUILDER}
{$DEFINE CBUILDER_VCL_10_0_SEATTLE}
{$ELSE}
{$DEFINE DELPHI_VCL_10_0_SEATTLE}
{$ENDIF}
{$ENDIF}
//Delphi & CBuilder 10.1 Berlin (BigBen)
{$IFDEF VER310}
{$DEFINE VCL_10_1_BERLIN}
{$IFDEF CBUILDER}
{$DEFINE CBUILDER_10_1_BERLIN}
{$ELSE}
{$DEFINE DELPHI_10_1_BERLIN}
{$ENDIF}
{$ENDIF}
//Delphi & CBuilder 10.2 Tokyo (Godzilla)
{$IFDEF VER320}
{$DEFINE VCL_10_2}
{$IFDEF CBUILDER}
{$DEFINE CBUILDER_10_2}
{$ELSE}
{$DEFINE DELPHI_10_2}
{$ENDIF}
{$ENDIF}
//Delphi & CBuilder 10.3 Rio (Carnival)
{$IFDEF VER330}
{$DEFINE VCL_10_3}
{$IFDEF CBUILDER}
{$DEFINE CBUILDER_10_3}
{$ELSE}
{$DEFINE DELPHI_10_3}
{$ENDIF}
{$ENDIF}
//Delphi & CBuilder 10.4 Sydney (Denali)
{$IFDEF VER340}
{$DEFINE VCL_10_4}
{$IFDEF CBUILDER}
{$DEFINE CBUILDER_10_4}
{$ELSE}
{$DEFINE DELPHI_10_4}
{$ENDIF}
{$ENDIF}
//Delphi & CBuilder 10.5 (Olympus) 同名:Delphi 11.1
{$IFDEF VER350}
{$DEFINE VCL_10_5}
{$IFDEF CBUILDER}
{$DEFINE CBUILDER_10_5}
{$ELSE}
{$DEFINE DELPHI_10_5}
{$ENDIF}
{$ENDIF}