Quantcast
Channel: Latest blog entries - Embarcadero Community
Viewing all 1683 articles
Browse latest View live

Delphi/C++Builder 10.2 Tokyo Pro: Kostenfreies Mobile Add-On für die Entwicklung für iOS und Android

$
0
0

Kunden, die eine aktuelle Delphi oder eine aktuelle C++Builder Professional Lizenz erwerben, oder Kunden, die ein 10.2 Tokyo Professional schon vor einiger Zeit erworben haben und eine aktive Update Subscription besitzen, können sich das Mobile-Add-On, für die Entwicklung von iOS und/oder Android Apps, kostenfrei anfordern. Oder kurz: Alle, die ein aktuelles Delphi/C++Builder haben, bekommen das Mobile-Add-On kostenfrei.

Hier dazu eine kleine FAQ:

F: Wo bekomme ich meine Seriennummer?
A: Gehen Sie dazu auf die Promotion-Website und fordern Sie Ihre Seriennummer an

F: Wie installiere ich das Mobile-Add-On? Was muss ich herunterladen?
A: Hier muss man zwei Fälle unterscheiden: GetIt-Webinstaller (auch ESD-Installer genannt) oder der Offline-Installation (von der ISO)
Voraussetzung ist, daß man die Basisinstallation der Professional Edition bereits durchgeführt hat!

  • GetIt Installer:
    In der IDE (Delphi oder C++Builder Professional) gehen Sie bitte in den Lizenzmanager und registrieren Sie die Seriennummer für das Mobile-Add-On: In der IDE: Hilfe | Lizenzmanager -> Registrieren
    Schliessen Sie den Lizenzmanager
    Schliessen Sie die IDE
    Starten Sie die IDE erneut und wählen Tools | Plattformen verwalten
    Wählen Sie iOS und/oder Android Entwicklung

  • Offline-Installation / ISO:
    Führen Sie eine Änderungsinstallation über die Windows-Systemsteuerung durch
    Windows 10: "Apps und Features" (je nachdem, wie es Microsoft heute mal wieder nennt) ODER
    Windows 7: "Programme und Features"
    Suchen Sie den Eintrag "Embarcadero RAD Studio 10.2"
    Ändern Sie die Installation (rechte Maustaste -> Ändern)
    Wählen Sie Upgrade und fügen die Seriennummer für das Mobile-Add-On hinzu
    Folgen Sie den Anweisungen

Herunterladen muss man nichts. Das wird automatisch (GetIt-Installation) durchgeführt oder ist auf der ISO schon enthalten.

F: Woran erkenne ich, ob ich den GetIt/Features/ESD-Installer oder die ISO Datei verwendet habe?
A: Das ist bei laufender IDE schnell erkennbar: Gibt es einen Menüeintrag Tools | Plattformen verwalten, dann hat man den GetIt/Feature/ESD-Installer verwendet. Ist der Menüpunkt nicht da, dann hat man die ISO verwendet

F: Ich habe ursprünglich von der ISO Datei installiert. Kann ich die GetIt-Installation benutzen?
F: Ich habe die GetIt Installation ursprünglich verwendet. Kann ich jetzt die ISO Datei verwenden?
A: Nein. Ich wiederhole: Nein. Man darf die GetIt- und die ISO-Installation nicht mischen. Das führt in ein Chaos. Hat man sich initial für eine Installationsart entschieden *muss* man dabei bleiben. Erst nach einer Bereinigung hat man wieder die Wahl...... dies betrifft natürlich nur die Version (10.0, 10.1 oder 10.2), die man ändern/aktualisieren/erweitern möchte. Versionsübergreifend hat man als Basis jeweils wieder die Wahl.

F: Wo finde ich die aktuellen Installationsdateien?
A: ISO: https://cc.embarcadero.com/item/30822
Web-Installer: https://cc.embarcadero.com/item/30820

F: Gilt das auch für das RAD-Studio in der Professional Edition?
A: Im RAD Studio Professional ist das Mobile-Add-On von Haus aus integriert und kann direkt installiert werden

 


Read More

New in 10.2.3: CMake Support for iOS and Android

$
0
0

We've introduced some great new features for C++Builder in 10.2.3.  Last week, I wrote about CMake support for our compilers. That post covered what CMake is, and how to use it for Windows, both Win32 and Win64.  If you haven't read it, please do; it's worth reading before this post.

Today I'd like to cover using CMake for mobile, iOS and Android.  This is both how to invoke CMake, and how to write mobile-specific information in a CMakeLists.txt file.

CMake for iOS and Android

When building with CMake and targeting Windows, you specify that you want to use our Win32 or Win64 C and C++ compilers. Once CMake knows what compiler you want to use, it takes it from there:

.
-- Win32:
cmake -DCMAKE_C_COMPILER=bcc32x.exe -DCMAKE_CXX_COMPILER=bcc32x.exe -G Ninja

-- Win64:
cmake -DCMAKE_C_COMPILER=bcc64.exe -DCMAKE_CXX_COMPILER=bcc64.exe -G Ninja 

This is because you are building and targeting the same platform.  You are building on Windows, and targeting Windows.  But for iOS32, iOS64, and Android, you are building on a different platform than you are targeting: that is, you are cross-compiling.

To cross-compile, instead of specifying the compiler you use, you specify a toolchain.  This is a cmake file that tells CMake how to use the compilers and for our mobile platforms, contains full cross-compilation information.  These toolchain files also set up extra deployment options - things like the splash screen images - that are specific to each platform.

Our cross-compile toolchain files share the same name as the compiler they use, eg bccaarm (our compiler) is bccaarm.cmake.  Here are the command lines to use:

iOS32:

.
cmake -DCMAKE_TOOLCHAIN_FILE="<BDS>\cmake\bccios32.cmake" -G Ninja

iOS64:

.
cmake -DCMAKE_TOOLCHAIN_FILE="<BDS>\cmake\bccios64.cmake" -G Ninja

Android:

.
cmake -DCMAKE_TOOLCHAIN_FILE="<BDS>\cmake\bccaarm.cmake" -G Ninja

That's even less to type than you use for Windows!

Don't forget, this assumes that you're invoking CMake from the folder where you CMakeLists.txt file is located.  If it's somewhere else, you can specify the path at the end of the command line, eg "... -G Ninja .." or "... -G Ninja c:\my\path".

Mobile-specific info in a CMakeLists.txt

Mobile targets are unlike Windows in that you can deploy your project to a mobile device, and that includes deploying a number of files that end up in the app bundle or package.  You do this through paserver as normal, so make sure paserver is installed and you can deploy through the IDE before you try on the command line.

We have a number of macros and variables you can use to tell CMake mobile-specific things, which include:

iOS:

  • Macros: The device family, eg iPhone and/or iPad; supported device orientations; background mode; and additional files that need to be deployed.  These are all the equivalents of settings in your Project Options.
  • Variables: The app name, SDK, certificate, provisioning profile, a large number of items that go into the info.plist file such as the bundle name, camera usage, etc etc; arbitrary info.plist options; and the icon and image files.  

Android:

  • Macros: jar files to add to classes.dex; permissions; and additional files to deploy.
  • Variables: project location, KeyStore info (password, alias, etc); services; manifest information such as the label, version, install location, etc etc; splash images; style; icon and image files; are more. 

Our documentation has a full list.  You can use all the macros and variables; some variables have preset fixed values which you can read in order to make target-specific configuration inside your CMakeLists.txt file.

Configuring CMakeLists.txt based on target

A CMakeLists.txt file is a generic project description, but you will want to have info in it that specifies, say, the Android manifest information that is used when targeting Android.  How do you do this?

The answer is to add an if statement based on the value of the EMBT_TARGET variable.  This is set for the platform, so for Android you would check

.
if(EMBT_TARGET STREQUAL Android)
  // ... Android-specific CMake config here
endif()

EMBT_TARGET can be:

  • "Android"
  • "iOS32"
  • "iOS64"
  • "Windows"

And you can use this to add info for each platform to your config.

Summary

That's it!  The core points are:

  • Specify the toolchain file to use when building for iOS or Android
  • In your CMakeLists.txt file, check EMBT_TARGET and use that to gate target-specific configuration, such as deployment or manifest/info.plist info

Next up in this series on CMake: using Ninja!

 


Read More

C++ Quality in 10.2.3

$
0
0

Every RAD Studio release, we focus on what we call QPS: Quality, Performance, Stability.  Recent releases of C++Builder have included:

This isn't an exhaustive list, just some notable improvements.  (One other is to do with Boost, but there are more.)  One notable thing is how compatible C++Builder is: we find that we and you our users are typically finding it much easier than in the past to add in third party libraries to your projects, add C++Builder compatibility to third-party source code even when it's been written to be compiler-specific, such as MSVC-specific, etc.  This is very good.

C++ Quality in 10.2.3

In 10.2.3, our quality improvements have largely focused on two areas:

  • Compiler quality: fixes for codegen, RTL, debugging
  • Code completion in the IDE

Let's look at both.

Compiler Quality

We have addressed a number of issues, including debugging issues, the most notable of which is with large stack variables (stack allocations larger than one page, or 4KB); deriving exceptions from System::Exception; integrating with the memory manager; and extended (Delphi-style) RTTI generation.

Code Completion

Code completion is an important IDE feature.  C++Builder has had C++ code completion for many years, but sometimes it did not the quality we aim for.  We have significant plans for this feature in a future release, but in the meantime we can and have worked to greatly improve the experience you have with our existing implementation.

There were a number of problems we saw in code completion. These ranged from the inconvenient, such as invoking completion and the results list being empty, to the more serious, such as completion bringing down the IDE. There were a number of problems all collecting together to cause this behaviour, and every one we have identified is fixed.

As of today, we now see:

  • Code completion results returned more often, more accurately, and often faster
  • Inconsistencies such as completion showing sometimes, and not other times, resolved
  • IDE stability issues resolved

If you rely on IDE tooling such as code completion, using C++Builder 10.2.3 will give significant productivity improvements.  We strongly recommend updating.

 


Read More

Video Tutorial#6: Ressourcen BMP/JPG in Delphi einbinden

$
0
0

Das nächste, kurze Videotutorial:
- Wie bindet man Ressourcen in seinem Delphi Programm ein und kann diese nutzen.
[YoutubeButton url='https://www.youtube.com/watch?v=34gaDgbDzu4']

Read More

RTL Enhancements in RAD Studio 10.2.3

$
0
0

As listed in the "What's New in 10.2.3" DocWiki page, http://docwiki.embarcadero.com/RADStudio/Tokyo/en/10.2_Tokyo_-_Release_3, among the changes, new features, and fixes in the latest update of 10.2 Tokyo.

One of the added features is MIME support improvements for the REST Client library. This was achieved by adding a new internal TMimeTypes class to handle the various mappings and enhancing MIME content-types in the TRESTClient component. Particularly, in the System.Net.Mime unit there is now:

* A TMimeTypes class allowing to map file extensions to mime types and backward, to iterate registered file extensions and mime types. This is based on a list of standard MIME types, including roughly 1,000 entries -- see image below.
* A TAcceptValueList class allowing to analyze Accept-Xxx request parameters and negotiate response. For example, it can analyze accept request and decide weather to respond with appropriate content or not, and in case which content type to use.

Beside this improvement in MIME support, there are other HTTP Client library improvements in Proxy support, in a more consistent stream posting implementation, and better support for forwarding cookies in a redirect, and finally the support for login with a blank password.

In different RTL areas, we made some further changes to System.Pas (after those in 10.2.2) to better support third party memory managers -- something that got inadvertently broken in an earlier release. We also made some DUnitX fixes for the Linux platform.

Finally, we made a few changes to some Windows API calls to use dynamic invocation to offer better Windows XP compatibility (even though the platform is not officially supported).

Among the bugs we fixes, notice a few:

- TJSON.ObjectToJsonObject raise an exception when object is nil (RSP-18631 in Quality Portal)

- RegEx.Replace replaces at wrong position (1 byte offset) on Andriod and iOS (RSP-18921)

- Regression: TQueue data overwriting (RSP-17728

These are not big uptakes, but a collection of smaller enhancements and fixes that help improving the product and making it more robust. Overall, if you look in https://quality.embarcadero.com/secure/Dashboard.jspa?selectPageId=13100 you can see another good spike of closed issues.


Read More

Dynamic Library Loader – My first published GitHub project!

$
0
0

A few weeks ago, I began a live-streamed coding project to develop a game engine named DarkGlass using Delphi. When I began the project, I knew that it was possible that several useful libraries might drop out of the development process, and so I have been working to separate the concerns of each piece of the code. Today, my first “useful” code library from that project can be considered at release status.

The darkDynLib library.

Okay, so my opening paragraph has a couple of slight exaggerations.

First, to call the project at release status is perhaps a stretch. You could can consider this a beta release. And second, to call the library useful is certainly accurate, but by the narrowest of margins. This library is designed simply to load dynamic libraries, such as .dll/.so/.dynlib files, and locate entry points within them. Handy for sure, but hardly a complex task. darkDynLib is, however, a cross platform library which is able to handle this task on any of Delphi’s target platforms.

This is however the first of many libraries that I plan to add to GitHub as my game project develops, and it is complete in that it has been tested to be working, and includes documentation in the form of a .chm file.

Testing Caveats.

While I am confident that this library will work for all supported Delphi targets, I have thus far only tested it on Windows (32&64) and Linux. I’ll be confirming Android, iOS and OSX support in the next few days (maybe a week). Having written a comparable library in the past, and tested that on all platforms, I know that if there are issues with the remaining platforms, they’ll be trivial to correct. If you try it and have problems, please drop me a comment here and I’ll keep you posted when testing is complete.

Conclusion

This is technically my first GitHub release, and so I wanted to share it with you.
The sources can be downloaded here: https://github.com/chapmanworld/darkDynlib 
I hope someone finds it useful!

Thanks for Reading!


Read More

New in 10.2.3: Using CMake with Ninja

$
0
0

One big new feature in 10.2.3 is support for building with CMake. If you haven't already, read the previous two posts: introduction to CMake and building with Windows, and building for iOS and Android.

Today I'd like to cover using CMake generators, and specifically Ninja for fast parallel builds.

 

CMake Generators

CMake is a compiler- and platform-independent project system, but despite its name it doesn't actually do any making or building. Instead, it uses the tools already on your system, and converts the CMakeLists.txt file into the data these tools need to build.  This conversion is a generator: it generates the files / data for a specific build system.  Thus, once you've generated these once, you use that tool to build.  You only need to re-run CMake itself if your project changes, eg by adding a new file, ro changing config.

Specify the generator with the -G command line switch.

You can, if you want, use old-fashioned makefiles.  Do so with -G"BorlandMakeFiles", if you want to use make. You could use any of the other generators too. However, the one that we specifically support with CMake is Ninja.

Ninja

Ninja is a very small and fast build system.  It comes as a single EXE, just like a traditional Delphi or C++Builder app.  It also allows parallel builds.  C++Builder already supports parallel compilation, but Ninja has a very nice implementation.

To use it, specify -G Ninja on the command line:

.
cmake -DCMAKE_TOOLCHAIN_FILE=bccaarm.cmake -G Ninja

Here, building for Android (using the bccaarm toolchain file.)  CMake will do its stuff and, using the Ninja generator, create a few files Ninja uses to build:

Then, once CMake is complete, you can build your project just by invoking ninja:

.
ninja

Simple as that! Ninja will take over and build - and do so in parallel. If you open Task Manager, you can see multiple copies of the compiler:

And the command line serializes the parallel output, and you can see here the status as several steps of seven are completed.

Overview

Using Ninja is very easy - in fact, all our examples use it, and our documentation includes the steps to install.

It is a fast, lightweight build system that is a great addition to using CMake in general, for parallel building on your local machine.

 

 


Read More

darkUnicode codec for Delphi

$
0
0

Another library to drop out of my Dark Glass development project today is my unicode codec (now named darkUnicode).
https://github.com/chapmanworld/darkUnicode

This simple class can be used to encode and decode unicode code-points by hand (independent of RTL functions to do the same), and I’ve used it previously to create my own unicode text buffer and stream support.  It can also  be used to determine the unicode format of a text file, by calling the DecodeBOM() method in the appropriate order.

Tip: Depending on Little / Big Endian, the BOM for UTF-32 formats may match BOM for a UTF-16 format when only considering the first 16-bits, so test for 32-bit BOM first.

I hope someone finds this library useful.

Thanks for Reading!


Read More

Вглубь технологий InterBase 2017 с Дмитрием Кузьменко

$
0
0

В стремительном темпе выхода все новых и новых версий продуктов Embarcadero для разработчиков, по-прежнему не теряется такой важный и интересный элемент, как СУБД InterBase. Практически в любом рассказе про решения Embarcadero, Interbase появляется не только, как доступный вариант выбора для хранения данных, но и важнейшая составная часть многих решений, например RAD Server.

При всей легковесности и нетребовательности, InterBase 2017 - мощная современная СУБД, обладающая впечатляющим набором возможностей и построенная на передовых технологиях. 

Заглянуть "под капот" InterBase, познакомиться с глубинными возможностями и их практическим применением вы можете на очередном вебинаре на русском языке, который состоится 22 марта 2018 года в полдень по московскому времени. Приятно объявить, что в качестве основного докладчика в вебинаре примет участие ведущий отечественный эксперт по InterBase/Firebird - Дмитрий Кузьменко, IBase.ru.

 

 
 
Interbase 2017 - новые возможности и их применение
 
 
 
В вебинаре участвует ведущий эксперт по InterBase и FireBird – Дмитрий Кузьменко.

Тема вебинара:
Новые возможности InterBase 2017, и их использование в практических задачах. На вебинаре будет рассказано про расширения SQL - derived tables, truncate table, индексы по выражениям, время ожидания транзакции, эксклюзивный режим транзакций. Также будут рассмотрены средства общего улучшения функциональности и производительности - дополнения isql, change views, мониторинг всех баз данных через таблицы tmp.
 
 
22 марта 2018 12:00 МСК.
 
Зарегистрироваться
 
 

 


Read More

Москва - Весна - Embarcadero - Sencha

$
0
0

Более 120 человек стали участниками первого в этом году "живого" семинара Embarcadero. 

Необычность этой встречи заключалась в том, что он был посвящен продуктам и решениям сразу двух компаний: Sencha и Embarcadero. Я уже неоднократно рассказывал (например, https://community.embarcadero.com/blogs/entry/embarcadero-delphi-sencha) о союзе этих компаний под эгидой Idera, компаний достаточно разных, выпускающих совершенно различные продукты для разработчиков, но объединенных похожим видением, как должны выглядеть решения для быстрой разработки корпоративных и кроссплатформенных приложений.  Sencha пользуется заслуженной популярностью на рынке разработки надежных корпоративных WEB-приложений, Embarcadero вот уже много лет используется огромным числом отечественных пользователей для быстрого создания нативных приложений и систем для Windows, Linux и мобильных платформ.

Так совпало, что семинар состоялся практически сразу после выхода самого свежего релиза RAD Studio Tokyo 10.2.3, и мы постарались рассказать о расширении его возможностей и показать, в том числе, что уже сделано для интеграции наших решений, и в каком направлении направлены наши усилия.

На мой взгляд, всем очень повезло, что представлять продукты Sencha к нам приехала ведущий специалист по  ExtJS и другим решениям, с огромным опытом разработки и поддержки WEB-приложений - Ольга Петрова. Ее глубокие знания, уверенный стиль изложения и природный шарм произвели нужное впечатление на всех слушателей. 

Если говорить об итоге, то очевидно, что совместный семинар стал успешным событием. Мне лично он принес новые знания и понимание пользы содружества наших продуктов, а нашим слушателям - открыл новые возможности, идеи и горизонты развития своих систем и продуктов.

После технической подготовки мы планируем предоставить доступ к материалам семинара. 

Темы докладов перечислены в блоге https://goo.gl/H3co36  

 


Read More

Не Firemonkey единой - вебинар Embarcadero

$
0
0

Приглашаем всех на интересный вебинар, посвященный еще одной альтернативе FireMonkey для разработки мобильных приложений на Delphi. Это тем более интересно, поскольку в вебинаре принимает участие автор разработки Ярослав Бровин - один из бывших разработчиков FireMonkey. Вебинар пройдет во вторник 27 марта в полдень по московскому времени. 

 
 
FGX Native. Новейшая кроссплатформенная платформа для мобильной разработки на Delphi.
 
 
 
На вебинаре познакомимся с текущей разработкой новой кроссплатформенной платформы, позволяющей создавать нативные приложения с быстрым откликом, плавной анимацией, продвинутой системой выравнивания, поддержкой RTL языков, оптимизированной работой с изображениями, быстрой канвой и многим другим. RAD Studio, Android/iOS. 
 
 
 
27 марта 2018 12:00 МСК.
 
Зарегистрироваться
 
 

 


Read More

C++ Builder 10.2.3 - CMake and Ninja Command-Line Support

$
0
0

Introduction

CMake is a popular C++ build tool. RAD Studio 10.2.3 Tokyo provides support for building CMake projects on the command line using RAD Studio compilers. 10.2.3 also specifically supports using Ninja with CMake, allowing for very fast parallel builds.

This will allow you to easily build third-party libraries without converting them to a C++Builder project. You can also use Ninja for improved build times.

CMake supports RAD Studio's Clang-enhanced compilers, and for Win32 uses the new Clang-enhanced driver, bcc32x. CMake command line support is provided for Windows, Android, and iOS.

Installing CMake and Ninja

CMake

Download and install CMake 3.10. Use the binary installer, since it can optionally add CMake to the system path. Make sure you select that option during the installation.

CMake files are located in C:\Program Files (x86)\Embarcadero\Studio\19.0\cmake. However, to prevent errors in the build process, you need to move one file manually. Follow the steps below to do this:

1.       Locate your CMake installation folder and the Modules\Platform subfolder. E.g. C:\Program Files\CMake\share\cmake-3.10\Modules\Platform

2.       Locate the Windows-Embarcadero.cmake file and make a backup.

3.       Copy Windows-Embarcadero.cmake from the Studio\19.0\cmake folder and overwrite the version in the CMake folder.

We have greatly extended the inbuilt CMake support for the Windows compilers and you need to use this file to build successfully.

Ninja

Download and install Ninja 1.8.2. You’ll need to add it to the system path manually.

Ninja is a small build system with a focus on speed. It differs from other build systems in two major respects: it is designed to have its input files generated by a higher-level build system, and it is designed to run builds as fast as possible.

CMakeLists.txt

Here is an example CMakeLists.txt file to build one .cpp file:

cmake_minimum_required (VERSION 3.10)

project (GuessANumber)

set_embt_target("DynamicRuntime")

add_executable(GuessANumber Main.cpp)

What this  CMakeLists.txt file does is:

1. This file works with CMake 3.10 (that's ten not one) or higher,

2. There is a project called GuessANumber

3. The set_embt_target is an Embarcadero-specific line.  This macro specifies whether to link with the VCL or FMX, the dynamic runtime, or as a package.  Here we will be linking with the “DynamicRuntime”.

 4. Lastly, the add_executable says to build GuessNumber.exe, build Main.cpp.

Running CMake 

1. Open a RAD Studio Command Prompt.

C:\Program Files (x86)\Embarcadero\Studio\19.0\bin>

2. Change directory (cd) to the folder where the project source code is located.

C:\Program Files (x86)\Embarcadero\Studio\19.0\bin>cd C:\Users\amann\Documents\Embarcadero\Studio\Projects\CppGuessANumber\

C:\Users\amann\Documents\Embarcadero\Studio\Projects\CppGuessANumber>

For this exmaple, run CMake using this command ine: 

cmake -DCMAKE_C_COMPILER=bcc32x.exe -DCMAKE_CXX_COMPILER=bcc32x.exe -G Ninja

The –G Ninja generates build.ninja files.  The build.ninja file is generated into the build tree.

Running this cmake command produces this output:

-- The C compiler identification is Embarcadero 7.30.36015

-- The CXX compiler identification is Embarcadero 7.30.36015

-- Check for working C compiler: C:/Program Files (x86)/Embarcadero/Studio/19.0/bin/bcc32x.exe -- works

-- Detecting C compiler ABI info – done

-- Check for working CXX compiler: C:/Program Files (x86)/Embarcadero/Studio/19.0/bin/bcc32x.exe -- works

-- Detecting CXX compiler ABI info - done

-- Configuring done

-- Generating done

-- Build files have been written to: C:/Users/amann/Documents/Embarcadero/Studio/Projects/CppGuessANumber

Next, run ninja from the command line.

Ninja outputs this:

[1/2] Building CXX object CMakeFiles\GuessANumber.dir\Main.cpp.obj

Embarcadero C++ 7.30 for Win32 Copyright (c) 2012-2017 Embarcadero Technologies, Inc.

Embarcadero Technologies Inc. bcc32x version 3.3.1 (36350.30c6854.779bede) (based on LLVM 3.3.1)

Target: i686-pc-win32-omf

Thread model: posix

Main.cpp:

[2/2] Linking CXX executable GuessANumber.exe

 Embarcadero C++ 7.30 for Win32 Copyright (c) 2012-2017 Embarcadero Technologies, Inc.

Embarcadero Technologies Inc. bcc32x version 3.3.1 (36350.30c6854.779bede) (based on LLVM 3.3.1)

Target: i686-pc-win32-omf

Thread model: posix

bcc32x.exe: warning: argument unused during compilation: '-nobuiltininc'

bcc32x.exe: warning: argument unused during compilation: '-Xclang -cxx-abi'

bcc32x.exe: warning: argument unused during compilation: '-Xclang borland'

 "C:\PROGRA~2\EMBARC~1\Studio\19.0\bin\ilink32.exe" @"C:\Users\amann\AppData\Local\Temp\GuessANumber-817693.cfg"

Turbo Incremental Link 6.90 Copyright (c) 1997-2017 Embarcadero Technologies, Inc.

And our GuessANumber.exe gets created!

Advantages of CMake Support for C++Builder

·       Many third-party open source C++ libraries come packaged as CMake projects.  In the past, to use these you'd have to create a C++Builder project for them, which is manual work.  Now, you can just build them on the command line right away.

·       This makes it significantly easier for you to use other common libraries in your projects.

·       One secondary item is that we support using Ninja with CMake. This allows parallel building. We already support parallel compilation in C++Builder, but I'll cover Ninja in a followup blog post.

 


Read More

LIVE! with TMS Software’s Bruno Fierens & Holger Flick

第35回 エンバカデロ・デベロッパーキャンプ・イン東京 B4フォローアップ

$
0
0

始めに

第35回デベロッパーキャンプのB4セッションにて、データベースの依存性排除についてお話ししました。その中でFireDACのマクロ機能を用いて依存性を排除する手法が存在する事に触れましたが、時間の関係上具体的なデモは出来ませんでした。 本記事ではそのフォローアップとしてFireDACのプリプロセス機能とマクロ機能をご紹介します。

FireDACのプリプロセス機能とマクロ機能

プリプロセス機能とは、FireDACがSQLコマンドを実行する前に、実行するRDBMSに応じてSQLコマンドを置換する機能です。また、マクロ機能はRDBMSのSQLの「方言」を抽象化しRDBMSに応じた関数に置換する機能です。

例えば、Oracle、SQL Server、InterBaseでシステム日時を取得するクエリは次のようになります。

RDBMS クエリ
Oracle select sysdate from dual;
SQL Server select getdate();
InterBase select current_timestamp from rdb$database;

 

これらの「方言」をFireDACのプリプロセス機能とマクロ機能で吸収すると以下のようになります。TFDQueryのSQLプロパティに以下の値を設定します。

 select {CURRENT_TIMESTAMP()} {if Oracle} from dual {fi} {if interbase} from rdb$database {fi} 

マクロ「CURRENT_TIMESTAMP()」はシステム日時を取得するマクロです。また「{if~fi}」で囲まれた部分がFireDACのプリプロセス機能によるRDBMSの種類に応じた条件分岐です。RDBMSがOracleならば、"from dual"が、InterBaseならば、”from rdb$database "が展開されます。

これをFireDACのモニタ機能を使って、実際に実行されたSQLをログより確認しましょう。

81262180001 11:04:43.608 >> Prepare [Command="select {CURRENT_TIMESTAMP()} {if Oracle} from dual {fi} {if interbase} from rdb$database {fi}"] 
81262180001 11:04:43.609      . Preprocessed [CMD="select SYSDATE  from dual  ", FROM="dual", VP=0, VPE=0, OBP=0, CK=1]
(中略)
81290460001 11:04:46.432 >> Prepare [Command="select {CURRENT_TIMESTAMP()} {if Oracle} from dual {fi} {if interbase} from rdb$database {fi}"]
81290620001 11:04:46.452  . Preprocessed [CMD="select GETDATE()  ", FROM="", VP=0, VPE=0, OBP=0, CK=1]
(中略)
81311560001 11:04:48.539 >> Prepare [Command="select {CURRENT_TIMESTAMP()} {if Oracle} from dual {fi} {if interbase} from rdb$database {fi}"]
81311560001 11:04:48.541  . Preprocessed [CMD="select CURRENT_TIMESTAMP   from rdb$database ", FROM="rdb$database", VP=0, VPE=0, OBP=0, CK=1]
(以下略)

ログの「Preprocessed [CMD=」の部分が実際に発行されたSQLコマンドです。

このようにプリプロセス機能とマクロ機能を用いれば、RDBMSの「方言」に依存しないでSQLコマンドを実行することが出来ます。

プリプロセス機能とマクロ機能についての詳細は以下のDocWikiの以下の項目を参照してください。

http://docwiki.embarcadero.com/RADStudio/Tokyo/ja/コマンド_テキストのプリプロセス(FireDAC)

http://docwiki.embarcadero.com/RADStudio/Tokyo/ja/式の作成(FireDAC)


Read More

10.2.3でのC++の品質

$
0
0

この記事は、DAVID MILLINGTONによるC++ Quality in 10.2.3の抄訳です。

すべてのRAD Studioのリリースでは、品質、パフォーマンス、安定性というQPSに焦点を当てています。

C++Builderの最新リリースには以下が含まれています:

  • 10.2.0:リンカに関する多くの作業。 改良されたコードジェネおよび最適化; デバッグの改善(デバッグ情報の最小化、デバッグの改善)
  • 10.2.1:CodeGuard for Windows 8.1および10; 例外処理、標準、およびデバッグの改善のグループ
  • 10.2.2:さらなるリンカーの品質の仕事; 例外処理、テンプレート、エキスポート/インポートの動作などのさまざまな修正が含まれています。

 

10.2.3でのC++品質


10.2.3では、弊社品質向上は主に次の2つの分野に焦点を当てています。

  • コンパイラの品質:codegen、RTL、デバッグの修正
  • IDEでのコード補完

両方を見てみましょう。

 

コンパイラの品質

弊社はいくつかの問題に取組みました。インクルーディングやデバッグ時の問題です。最も顕著なのは大きなスタック変数(1ページ以上のスタック割り当てまたは4KB); System::Exceptionから例外を派生;  メモリマネージャと統合; 拡張された(Delphiスタイルの)RTTI生成が含まれます。

 

コード補完

コード補完は重要なIDE機能です。 C++Builderは長年にわたってC++コードの補完を行っていましたが、時にはそれが私たちが目指す品質ではありませんでした。 将来のリリースでこの機能の重要な計画を立てていますが、その間に既存の実装の経験を大幅に改善することができました。

コード補完にはいくつかの問題がありました。 これらは不完全なものから、補完を呼び出すこと、結果リストが空であることなど、より深刻なものまでありました。例えば、IDEの補完を打止めさせるなどです。 この現象を引き起こすために集まっている問題は数多くあり、弊社が特定したすべての問題は修正されています

 

現時点では、次のようになっています。

  • コード補完の結果はより頻繁に、より正確に、より速く動作するように改善
  • たまに起きる補完の不一致は、解決されました
  • IDEの安定性の問題が解決しました 

コード補完などのIDEツールを使用する場合、C++Builder 10.2.3を使用すると、生産性が大幅に向上します。
更新を強くお勧めします。

 


Read More

Four Humble Ideas for Embarcadero

$
0
0

I hereby humbly offer the following four suggestions to improve the Delphi product and community.

Acquire the Assets of DevJet

Have you guys seen the stuff done by DevJet?  This is some seriously excellent work.  They have two main projects — Documentation Insight and Code Insight Plus — that are both excellent, polished, and incredibly useful.  Code Insight Plus is worth its weight in gold.  Embarcadero should strongly consider including these two projects as part of the RAD Studio product.  Shoot, they should get DevJet to write a bunch of features for the IDE.

Now maybe DevJet doesn’t want to be acquired, I don’t know, so it’s just an idea.  But definitely worth considering.

Open Source Their Unit Tests

I’ve suggested this before, and want to suggest it again.  I can’t add much to the post other than to say there is no downside and all upside.  I argued pretty strenuously for this, and continue to believe it is a good idea.

Build for Raspberry Pi

I spent a bunch of time this weekend squaring away my four Raspberry Pi’s.  I have a 1, a 2, a three and a Zero.  They are fun.  They are cool.  They are powerful.  And, they are hard to develop for (though I am going to spend some time soon loading up ASP.NET core on to one of them.)  I think that the next big platform that Embarcadero should add is the Raspberry Pi.  It’s an ARM chip running Linux.  It would be awesome to take the current Linux capabilities and make them available to run on Pi’s.  I would love this.  Shoot, I got my Pi Zero for five dollars!  I would love to be able to write server applications and deploy them to a Raspberry Pi.  I absolutely am not the only one.  This would be a trailblazing thing to do, and could have a big impact on the spread of Delphi to new users.

Open Source (or at least put on GitHub) Their Visual Frameworks (RTL, VCL, and FMX)

It’s time.

I was at Philly Code Camp this weekend.  It was fun as always.  At the after-party on Friday night I talked to a guy who took a day long class on Microsoft’s Rosalyn compiler.  He talked about all the cool things he was building to automate code reviews by doing static analysis on the compiled code using the extensions from Rosalyn.  I was at a talk where they mentioned how many bug fixes and improvements have come to .Net Core since it was open sourced.  And this is code from Microsoft.  Microsoft!  They open source their development environment and it is thriving. Check this out — here is Anders Hejlsberg’s check-in log for TypeScript for the month of March.  You can interact with Anders on GitHub!

Embarcadero should follow suit.

Now, I can hear the objections.  So I’m not going to push to have these frameworks be open sourced.  I can understand why that might not happen.  But the source is already out there.  Why not put it on GitHub with the same license it has now?  You don’t have to open source it, but by putting it on GitHub you invite the community to provide pull requests with fixes and improvements.  You could recruit MVPs to vet the pull requests.  You can get the benefits of community input without an open source license.  The frameworks aren’t much good to anyone without the Delphi IDE and the Delphi compiler, so there isn’t much being given away.

It’s time.


Read More

Database and FireDAC Enhancements in RAD Studio 10.2.3

$
0
0

I already blogged about RAD Server changes and RTL fixes in the Delphi, C++ Builder and RAD Studio 10.2.3 update. Another area that has received attention is the database support in general, and FireDAC in particular. Below is a list with some of the most notable improvements, with the Quality Portal entry, if available.

FireDAC Improvements

FireDAC work was mostly focused at better handling of corner case scenarios, like the management of Null vs. Empty values for ftMemo fields (RSP-19938), a reduction of CPU consumption for idle applications (RSP-19881), a query OpenOrExecute method updating RowsAffected (RSP-19385), better Login Dialog scaling for HiDPI (RSP-16776).

The dev team also addressed specific database issues including an issue with Oracle queries with parameters over 1000 characters long (RSP-20057), some general issues in identifying parameters (RSP-19744), issues on DirectExecute with PostreSQL (RSP-19701), a MongoDB access from a Linux Apache Module (RSP-19908), and a MySQL "Data too large for variable" exception on certain string params.

A set of improvements relate with FireDAC's BatchMove architecture, including TFDBatchMoveSQLWriter support of NULL value (RSP-19746), OnWriteValue with text BLOBs (RSP-19733) and TFDBatchMoveDataSetWriter with the same data type (RSP-19732), but also RSP-19660 for dmAppendUpdate, reading CVS files on Android and iOS (RSP-19637)

DataSnap Fixes

Contrary to rumors, we are still actively involved in fixing issues in DataSnap and cleaning up some of the related infrastructure. This release adds the ability for a Datasnap server method on Apache to takes a TJSONObject parameter even if the method name does not start with "update", addresses memory leaks in WebModule.Response.SendResponse (RSP-20063), lack of OnError event on TDSServer (RSP-19661), C++ DataSnap wizard issues (RSP-19444), proxy server problems (RSP-18760), resolved a memory leak in TCP Datasnap server when OnCreateInstance and OnDestroyInstance event are handled and some more.

ReFind Update

This is a search replace tool helping in code migration, we fixed issues with {$IF CompilerVersion} claused (RSP-20025). The tools is available in our binaries and scripts are in the database section of the demos folder.

Conclusion

This is all for the database side of things in 10.2.3. Not a lot of feature work, but some good quality improvements, along with the feature work on RAD Server.


Read More

New in 10.2.3: FireMonkey UI Templates - Profile Screens

$
0
0

Delphi, C++Builder and RAD Studio 10.2.3 include 18 new FireMonkey UI templates, designed to highlight FMX's multi-device capabilities, showcase best practices, and help new users get started quicker. They showcase UI paradigms that mobile application developers need in today’s applications.

This blog post focuses on the three new profile screen GUI templates, available for download in GetIt (Tools > GetIt Package Manager > Sample Projects).

Each of the three templates uses one of the premium FireMonkey multi-platform styles.

Only the first template will be auto-opened after installing a GUI template, but you can access the other two templates by navigating to C:\Users\Public Documents\Embarcadero\Studio\19.0\Samples\Object Pascal\App Profile Screens 

Profile Screen #1:

 

Shown: FireUI Master view with custom Jet iOS style applied

  

Shown: Android 4” phone form factor with custom Jet style applied

 

Profile Screen #2:

Shown: Android 5” FireUI device view with custom Sterling style applied

 

 

Shown: GUI template running on the iOS Simulator with custom Sterling style applied

 

 

Shown: GUI template running on Windows with custom Sterling style applied

 

Profile Screen #3:

Shown: FireUI Master view with custom Sterling Windows style applied

 

Shown: FireUI iPhone 4.7" device view with custom Sterling iOS style applied 

 

Shown: Profile app running on the iOS Simulator with custom Sterling style applied

 


Read More

10.2.3 最新版の CMakeサポート

$
0
0

この記事は、DAVID MILLINGTONによるNew in 10.2.3: CMake Supportの抄訳です。

 C++Builder 10.2.3新機能、CMakeをコンパイラで使用するためのサポートです

この投稿はCMakeのシリーズ第1弾は、次の内容を解説しています:

  • CMakeとは
  • CMakeLists.txtファイルを書き込む方法
  • Windowsでプロジェクトをビルドする方法

CMakeとは

CMakeは、C++アプリケーションやライブラリのためのプラットフォームやコンパイラに依存しない、プロジェクト形式と考えることができます。

CMakeCMakeLists.txtというテキストファイルを使用しますので、編集可能です。その内容はビルドする必要のあるファイルやプロジェクト名、依存関係などです。次に例を示します。

cmake_minimum_required (VERSION 3.10)
project (MyProjectName)

add_executable(MyProjectName one.cpp two.cpp three.cpp)

上記内容説明

  • このファイルはCMake3.10(that's ten not one)以上で動作します
  • MyProjectNameと言うプロジェクトです
  • MyProjectName.exeは、one.cpp, two.cpp, およびthree.cppでビルドします

これはシンプルな例ですが、CMakeLists.txtファイルは、プロジェクトよりもC++Builderのプロジェクトグループに似ています。なぜなら、複数のプロジェクト、それらの間の依存関係などを指定できるからです。

CMakeはコンパイラ依存しないので、 ”cc on Solaris", "gcc on Linux", "clang on Mac"などビルドする方法にも対応できます。しかしそのためにはベンダーやプラットフォーム固有の設定を行う必要はあります。たとえば、C++Builderに特有のVCLまたはFMXランタイムとのリンクを指定する、またはダイナミックランタイムにリンクするなど、他のコンパイラと同等の機能を持ちますが、インプリメンテーションではまだ固有のものです。

CMakeは良いドキュメントを持っていますが、CMakeを知らないと少し不透明な部分があります。なので、個人的にはJeff Pershing's blog series on CMake
How to Build a CMake-Based Projectと Learn CMake's Scripting Language in 15 を読むことをおすすめ致します。そこにはCMakeのエキスパートになるような説明が豊富にあります。

C++BuilderCMakeサポートしたことのメリット

多くのサードパーティ、オープンソースのC++ライブラリは、CMakeプロジェクトとしてパッケージ化されています。 これらを使用するために、C++Builderプロジェクトを手動作業で作成する必要がありました。CMakeをサポートしたことで、すぐにコマンドラインでビルドすることができます。

これにより、プロジェクトで他の共通ライブラリを使用するのがはるかに容易になります。

もう1つは、CMakeNinjaを使用することをサポートしていることです。 これにより、並列構築が可能になります。 私たちはすでにC++Builderでの並列コンパイルをサポートしていますが、Ninjaについては後のブログ記事で説明します。

なにを追加したのか?

弊社では次のような追加しました。CMakeを使ってC++Builder Clangベースのコマンドラインコンパイラ(Win32、Win64、iOS32、iOS64、およびAndroid用)すべてのビルドをサポート。DocWiki C++BuilderでのCMakeの利用

(classic compilerではすでにCMake利用可能です)

WindowsでのCMake使用

インストール

  1. CMakeをダウンロードしてインストールします。 インストール時に、CMakeをシステムパスに追加するオプションを選択してください。 そうしない場合は、CMakeを使用するたびにそのフルパスを指定する必要があります。
  2. オプション強くお勧めしますが、Ninjaをダウンロードしてください。 これは単純なEXEです:あなたのシステムのどこかに配置し、その場所を手動でシステムパスに追加してください。
  3. C++Builder 10.2.3をインストール
  4. 非常に重要なインストール手順が1つあります。 これを見逃したり、奇妙なエラーメッセージが表示されたりすることはありません。 "Windows-Embarcadero.cmake"ファイルは、現在CMakeに同梱されているバージョンと比較して更新されています。 その後C:\Program Files (x86)\Embarcadero\Studio\19.0\cmake\Windows-Embarcadero.cmake をコピーして貼り付けます: C:\Program Files\CMake\share\cmake-3.11\Modules\Platform (3.11はCMake版です)ファイルを最初にバックアップしてください。

この最後のステップをやっていないと、CMakeを実行するときに紛らわしいエラーメッセージが表示されます。

-- Check for working C compiler: C:/Program Files (x86)/Embarcadero/Studio/19.0/bin/bcc64.exe -- broken

CMake Error at C:/Program Files/CMake/share/cmake-3.11/Modules/CMakeTestCCompiler.cmake:52 (message):

  The C compiler
    "C:/Program Files (x86)/Embarcadero/Studio/19.0/bin/bcc64.exe"
  is not able to compile a simple test program.

  It fails with the following output:
    [ -- Long compiler command line omitted -- ]

    error: invalid integral value 'd' in '-Od'

  CMake will not be able to correctly generate this project.

上記が表示される場合は、Windows-Embarcadero.cmakeをコピーしてください。 おそらく10.3で、更新された設定ファイルを出荷することなくCMakeをすぐにサポートできる予定です。

例 Windows CMakeLists.txt

非常にシンプルなCMakeLists.txtを示し、そのコンセプトを実証しました。 実際のプロジェクトのためのものを見てみましょう。 これは、昨年CodeRage用に作成したFireMonkey Windowsアプリケーション用です。

cmake_minimum_required (VERSION 3.10)
project (Mazes)

set_embt_target("FMX" "DynamicRuntime")

add_executable(Mazes CppMazes.cpp Algorithms.cpp Cell.cpp DistanceDijkstra.cpp
    Grid.cpp MainForm.cpp)

非常によく似ていますね。 Embarcadero固有の行、set_embt_targetが追加されています。 このマクロは、VCLまたはFMX、ダイナミックランタイム、またはパッケージとしてリンクするかどうかを指定します。 これらは組み合わせることができ、当社のマニュアルに記載されています。

VCLアプリケーションを構築する場合は、

set_embt_target(VCL)

動的ランタイムとリンクしていない(指定されていないため)が、VCLとリンクしています。

通常のCMakeプロジェクトでは、add_executable呼び出しでWIN32を指定する必要があります。これは、コンソールアプリケーションではないことを指定します(つまり、PEフラグを設定してWinMainを使用します)。VCLまたはFMXを指定した場合、 この; 私たちは自動的に行います。 それを無効にして、必要に応じてコンソールを指定することができます。

共有ライブラリやパッケージを作成する方法、または共有ライブラリを作成する方法をもっと探したい場合? ドキュメントには、6つのサンプルCMakeLists.txtファイルがあります。

ビルド Windows

知る必要がある2つのコマンドライン
ビルドは非常にシンプルです。

CMakeをインストールしてあり、CMakeLists.txtファイルを用意します。
cmakeを呼び出して、bcc64またはbcc32xをC/C++コンパイラとして使用することを指定します。
CMakeは自動的にCMakeLists.txtファイルを探し、指定したコンパイラに基づいてWin32かWin64かどうかを判断します。

cmake -DCMAKE_C_COMPILER=bcc32x.exe -DCMAKE_CXX_COMPILER=bcc32x.exe -G Ninja

もしくは

cmake -DCMAKE_C_COMPILER=bcc64.exe -DCMAKE_CXX_COMPILER=bcc64.exe -G Ninja 

これはCMakeを実行し、Ninjaジェネレータを使用します。つまり、Ninjaが構築する必要があるファイルを生成します。他のポストでNinjaや他のジェネレータを使用する場合、このプロセスは一度だけ実行する必要があります。
新しいファイルを追加するなど、プロジェクトが変更されたときに更新プログラムを再度実行して更新することができます。一度だけですので、ビルドするたびに実行する必要はありません。

ビルド時にNinjaをコールする。

ninja

すごくシンプルです。少しの間ninjaビルドが表示された後、ベースフォルダ内に実行ファイルが出来上がります。

関連

 

[次回予告] CMake for iOS and Androidを使う

iOSとAndroidをターゲット設定する詳細を次回投稿します。

概要

CMakeの使用は実際はとても簡単です。 それをインストールし、CMakeLists.txtファイルがあることを確認し、cmakeを呼び出します。 その後、ninjaで構築します。

これにより、サードパーティのC++ライブラリを簡単に構築できます:cmakeをダウンロードして実行してください。CMakeLists.txtファイルを作成すると、独自のプロジェクトを構築できます。これにより、他のC++ライブラリやコードを使用するのが本当に簡単になるだけでなく、Ninjaなどのジェネレータを使用すると他の利点もあります(たとえば、速度など)。互換性があり、より幅広いC++世界とうまく統合できることは、弊社では他の場所からライブラリやコードを簡単に使用できるようにし、人々がC++Builderを使いやすいようにします。

10.2.3の新機能についての記事URL


Read More

Two Small RAD Studio 10.2.3 Patches

$
0
0

Embarcadero has releases a couple of small and focused patches for the recent RAD Studio, Delphi, and C++Builder 10.2.3 update.

The first is an Android Push Notification Patch available as https://cc.embarcadero.com/item/30831. This patch resolves an issue with push notifications on Android due to missing jar files. It fixes the publicly reported issue RSP-20137.

The second is fix for RAD Studio 10.2.3 RAD Server (EMS) Package Wizard Patch (and as such it is applicable only to Enterprise customers), available at https://cc.embarcadero.com/item/30832. In 10.2.2 a new RAD Server (EMS) project didn't have support for the Linux and the Win64 platforms by default. While adding it, the new wizard in 10.2.3 automatically adds the Linux target platform to both Delphi and C++Builder projects, even when not installed or not supported (C++Builder), and this causes the IDE to crash when using the wizard. In this case the readme has an incorrect reference to the issue addressed, as it lists the earlier bug resolved in 10.2.3, not the follow up problem addressed by the patch.


Read More
Viewing all 1683 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>