This blog post contains the version output for the C++ command line compilers that are included in C++Builder version 11 Alexandria.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
bcc32.exe --version C:Program Files (x86)EmbarcaderoStudio22.0bin>bcc32.exe --version Embarcadero C++ 7.60 for Win32 Copyright (c) 1993-2021 Embarcadero Technologies, Inc. Revision 7.60.7880.37811 bcc32c.exe --version C:Program Files (x86)EmbarcaderoStudio22.0bin>bcc32c.exe --version Embarcadero C++ 7.60 for Win32 Copyright (c) 2012-2021 Embarcadero Technologies, Inc. Embarcadero Technologies Inc. bcc32c version 5.0.2 (69de348c.c83071db.37689) (based on LLVM 5.0.2) Target: i686-pc-windows-omf Thread model: posix InstalledDir: C:Program Files (x86)EmbarcaderoStudio22.0bin bcc32x.exe --version C:Program Files (x86)EmbarcaderoStudio22.0bin>bcc32x.exe --version Embarcadero C++ 7.60 for Win32 Copyright (c) 2012-2021 Embarcadero Technologies, Inc. Embarcadero Technologies Inc. bcc32x version 5.0.2 (69de348c.c83071db.37689) (based on LLVM 5.0.2) Target: i686-pc-windows-omf Thread model: posix InstalledDir: C:Program Files (x86)EmbarcaderoStudio22.0bin bcc64.exe --version Embarcadero C++ 7.60 for Win64 Copyright (c) 2012-2021 Embarcadero Technologies, Inc. Embarcadero Technologies Inc. bcc64 version 5.0.2 (69de348c.c83071db.37689) (based on LLVM 5.0.2) Target: x86_64-pc-windows-elf Thread model: posix InstalledDir: C:Program Files (x86)EmbarcaderoStudio22.0bin bccaarm.exe --version Embarcadero C++ 7.60 for Android Copyright (c) 2012-2021 Embarcadero Technologies, Inc. Embarcadero Technologies Inc. bccaarm version 3.3.1 (37761.ab293fa.1a350c1) (based on LLVM 3.3.1) Target: thumbv7-none-linux-androideabi Thread model: posix bcciosarm64.exe --version Embarcadero C++ 7.60 for iOS 64-bit device Copyright (c) 2012-2021 Embarcadero Technologies, Inc. Embarcadero Technologies Inc. bcciosarm64 version 3.3.1 (37761.ab293fa.1a350c1) (based on LLVM 3.3.1) Target: arm64-apple-ios Thread model: posix |
If you need to test for specific C++Builder versions you can use a range of defines in your code. Here are a few code fragment examples.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 |
// create a C++ Multi-Device Application. // drop a TButton and TMemo on the form // Here is the header file declaration: //--------------------------------------------------------------------------- #ifndef MainUnitH #define MainUnitH //--------------------------------------------------------------------------- #include <System.Classes.hpp> #include <FMX.Controls.hpp> #include <FMX.Forms.hpp> #include <FMX.Controls.Presentation.hpp> #include <FMX.Memo.hpp> #include <FMX.Memo.Types.hpp> #include <FMX.ScrollBox.hpp> #include <FMX.StdCtrls.hpp> #include <FMX.Types.hpp> //--------------------------------------------------------------------------- class TForm2 : public TForm { __published: // IDE-managed Components TButton *Button1; TMemo *Memo1; void __fastcall Button1Click(TObject *Sender); private: // User declarations public: // User declarations String PlatformPath; __fastcall TForm2(TComponent* Owner); }; //--------------------------------------------------------------------------- extern PACKAGE TForm2 *Form2; //--------------------------------------------------------------------------- #endif Here is the TButton onClick event handler with code: void __fastcall TForm2::Button1Click(TObject *Sender) { switch (TOSVersion::Platform) { case TOSVersion::TPlatform::pfWindows: PlatformPath = "Windows"; break; case TOSVersion::TPlatform::pfMacOS: PlatformPath = "macOS"; break; case TOSVersion::TPlatform::pfiOS: PlatformPath = "iOS"; break; case TOSVersion::TPlatform::pfAndroid: PlatformPath = "Android"; case TOSVersion::TPlatform::pfWinRT: PlatformPath = "WinRT"; break; case TOSVersion::TPlatform::pfLinux: PlatformPath = "Linux"; break; default: PlatformPath = "Unexpected platform"; } Memo1->Lines->Add("TPlatform: "+PlatformPath); Memo1->Lines->Add(TOSVersion::ToString()); Memo1->Lines->Add("Name: "+TOSVersion::Name); Memo1->Lines->Add("Build: "+IntToStr(TOSVersion::Build)); Memo1->Lines->Add("Major: "+IntToStr(TOSVersion::Major)); Memo1->Lines->Add("Minor: "+IntToStr(TOSVersion::Minor)); Memo1->Lines->Add("Service Pack Major: "+IntToStr(TOSVersion::ServicePackMajor)); Memo1->Lines->Add("Service Pack Minor: "+IntToStr(TOSVersion::ServicePackMinor)); Memo1->Lines->Add( "C++Builder Compiler Version: " + IntToStr(__CODEGEARC__) ); Memo1->Lines->Add( "C++Builder Compiler Version (hex): " + Format("%x",__CODEGEARC__) ); Memo1->Lines->Add( "C++Builder Compiler Version: " + IntToStr(__CODEGEARC_VERSION__) ); #ifdef _Windows Memo1->Lines->Add("Defined: _Windows"); #endif #ifdef WIN32 Memo1->Lines->Add("Defined: WIN32"); #endif #ifdef __WIN32__ Memo1->Lines->Add("Defined: __WIN32__"); #endif #ifdef _WIN64 Memo1->Lines->Add("Defined: _WIN64"); #endif #ifdef __APPLE__ Memo1->Lines->Add("Defined: __APPLE__"); #endif #ifdef IOS Memo1->Lines->Add("Defined: IOS"); #endif #ifdef IOS64 Memo1->Lines->Add("Defined: IOS64"); #endif #ifdef __ANDROID__ Memo1->Lines->Add("Defined: __ANDROID__"); #endif #ifdef ANDROID Memo1->Lines->Add("Defined: ANDROID"); #endif #ifdef ANDROID32 Memo1->Lines->Add("Defined: ANDROID32"); #endif #ifdef ANDROID64 Memo1->Lines->Add("Defined: ANDROID64"); #endif #ifdef MACOS Memo1->Lines->Add("Defined: MACOS"); #endif #ifdef MACOS64 Memo1->Lines->Add("Defined: MACOS64"); #endif #ifdef OSX Memo1->Lines->Add("Defined: OSX"); #endif #ifdef OSX64 Memo1->Lines->Add("Defined: OSX64"); #endif #ifdef LINUX Memo1->Lines->Add("Defined: LINUX"); #endif #ifdef LINUX32 Memo1->Lines->Add("Defined: LINUX32"); #endif #ifdef LINUX64 Memo1->Lines->Add("Defined: LINUX64"); #endif #ifdef POSIX Memo1->Lines->Add("Defined: POSIX"); #endif #ifdef POSIX32 Memo1->Lines->Add("Defined: POSIX32"); #endif #ifdef POSIX64 Memo1->Lines->Add("Defined: POSIX64"); #endif #if defined(__CONSOLE__) Memo1->Lines->Add("Defined: __CONSOLE__"); #endif #if defined(CPUX86) Memo1->Lines->Add("Defined: CPUX86"); #endif #if defined(CPUX64) Memo1->Lines->Add("Defined: CPUX64"); #endif #ifdef CPU32BITS Memo1->Lines->Add("Defined: CPU32BITS"); #endif #ifdef CPU64BITS Memo1->Lines->Add("Defined: CPU64BITS"); #endif #ifdef __arm__ Memo1->Lines->Add("Defined: __arm__"); #endif #ifdef __arm64__ Memo1->Lines->Add("Defined: __arm64__"); #endif #ifdef __cplusplus Memo1->Lines->Add("Defined: __cplusplus"); #endif #ifdef __BORLANDC__ Memo1->Lines->Add("Defined: __BORLANDC__"); #endif #ifdef __BCPLUSPLUS__ Memo1->Lines->Add("Defined: __BCPLUSPLUS__"); #endif #if defined(__clang__) Memo1->Lines->Add( "Clang Version: " + IntToStr(__clang_major__) + "." + IntToStr(__clang_minor__) + "." + IntToStr(__clang_patchlevel__) ); Memo1->Lines->Add( "Clang Marketing Version: " + String(__clang_version__) ); #endif } |
Sample Screen Grabs using the Clang Win32, Win64 and iOS compilers.
Check out the improvements to import libraries on this OMF com/offer article.
Here are a few links to additional information related to this blog post.
https://docwiki.embarcadero.com/RADStudio/en/Predefined_Macros https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Predefined_Macros https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Clang-enhanced_C%2B%2B_Compilers http://clang.llvm.org/docs/LanguageExtensions.html#builtinmacros https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Predefined_Macros#C.2B.2B_Compiler_Versions_in_Predefined_Macros
https://en.cppreference.com/w/cpp/compiler_support
Design. Code. Compile. Deploy.
Start Free Trial Upgrade Today
Free Delphi Community Edition Free C++Builder Community Edition