TotteKarlsson 1 Posted October 15, 2021 (edited) Hello, Have anyone been able to ever build a VCL forms application using cmake? Following the documentation here simply don't work. Creating the simplest VCL application, with just the main form, and a CMake file that looks like this: CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0. FATAL_ERROR) set_embt_target("VCL" "DynamicRuntime") add_executable(DummyApp WIN32 arboreta.cpp TMainForm.cpp) And configuring to build with any of Embarcaderos compilers, bcc32, bcc32c and or bcc32x, using either ninja or the "Borland Compiler" option, gives this linker error, and other messages: λ make MAKE Version 5.41 Copyright (c) 1987, 2014 Embarcadero Technologies, Inc. -- Configuring done -- Generating done -- Build files have been written to: C:/builds/10.3/arboreta MAKE Version 5.41 Copyright (c) 1987, 2014 Embarcadero Technologies, Inc. MAKE Version 5.41 Copyright (c) 1987, 2014 Embarcadero Technologies, Inc. Scanning dependencies of target DummyApp MAKE Version 5.41 Copyright (c) 1987, 2014 Embarcadero Technologies, Inc. [ 33%] Linking CXX executable DummyApp.exe Embarcadero C++ 7.50 for Win32 Copyright (c) 2012-2021 Embarcadero Technologies, Inc. Embarcadero Technologies Inc. bcc32x version 5.0.2 (d939c99b.1e953156.37585) (based on LLVM 5.0.2) Target: i686-pc-windows-omf Thread model: posix InstalledDir: C:\Program Files (x86)\Embarcadero\Studio\21.0\bin bcc32x.exe: warning: argument unused during compilation: '-nobuiltininc' [-Wunused-command-line-argument] "\"C:\\Program Files (x86)\\Embarcadero\\Studio\\21.0\\bin\\ilink32.exe\"" "@\"C:\\Users\\totte\\AppData\\Local\\Temp\\DummyApp-95196a.cfg\"" Turbo Incremental Link 6.95 Copyright (c) 1997-2021 Embarcadero Technologies, Inc. Error: Unresolved external '_main' referenced from C:\PROGRAM FILES (X86)\EMBARCADERO\STUDIO\21.0\LIB\WIN32C\DEBUG\C0X32.OBJ Error: Unable to perform link bcc32x.exe: error: linker command failed with exit code 2 (use -Xdriver -v to see invocation) ** error 2 ** deleting DummyApp.exe ** error 1 ** deleting CMakeFiles\DummyApp.dir\all ** error 1 ** deleting all C:\builds\10.3\arboreta The above linker error indicate that the linker thinks this is a command line application, with a main() function, instead of a WinMain one. This is after copying the Windows-Embarcadero.cmake file to CMakes install directory. The problem is most likely in that file. Anyone knowing how to get past the linker error and build a VCL forms application using CMake instead of the IDE? Thanks, -tk Edited October 15, 2021 by TotteKarlsson Added content Share this post Link to post