How can I compile a Delphi application without using the IDE? - delphi

I need to build the components, package, and project file without using the Delphi XE7 RAD Studio IDE. Is there some way to do this using command line instead?

When you installed RAD Studio, it added a shortcut in the start menu named RAD Studio Command Prompt. Execute that shortcut. You now have a command prompt window for an environment that includes all you need to build at the comment line.
Change directory to the directory containing your .dproj files.
Execute the following command: msbuild YourProjectName.dproj.
If you have multiple projects build them all. Of course you'd want to script all this up in due course.
Control the build target (clean, make, build) and configuration (debug, release, win32, win64) using command line arguments as documented here: http://docwiki.embarcadero.com/RADStudio/en/Building_a_Project_Using_an_MSBuild_Command
For more details, start with the documentation here: http://docwiki.embarcadero.com/RADStudio/en/MSBuild_Overview

Related

Why MSBUILD gets error from Rad Studio 10.3 IDE but from command line works?

In a Rad Studio Rio C++ project, when I compile, I get:
MSBUILD : error E1028: unable to open output file '.\Win32\Debug\Unit1\obj': 'no such file or directory'
Note that it shows Unit1\obj, not Unit1.obj.
It works fine if I compile from command line using MSBUILD MyProject.cbproj
Also, it works fine if I set on the Run C++ compiler in separate process
Also, I have found that the problem is only when I use the Configuration Manager, assigning to the projectt an .optset file. If I unlink this .optset file, then it compiles from the IDE again.
It seems a bug.

Coverity support issue for Borland C++Builder

When I compile my code using Borland C++Builder (it is necessary for me to use only the Borland compiler), bcc32.exe is able to compile the code successfully. When I build this same code with the cov-build command inside of cmd.exe, the build fails with errors like:
cannot open source file "iostream"
What is the possible reason behind this, and how do I debug it?
Here is the code
Coverity requires that you configure your compiler in the same environment that you build it in. If you fail to do so, the configuration probes will not pick up your include paths, amongst other things.

msvcbuild - how to compile luajit

i'va just downloaded luajit and trying to compile it. i'm doing everything as it says here
to compile it i should execute msvcbuild from VS .NET Command Promt. so i installed VS 2010 and started VS 2010 Command Promt
and when i try to execute nsvcbuild it says "no such program and bla-bla-bla".
first i thought that there was no environment path. so i decided to find file msvcbuild.exe inside Program Files folder. and there is no such file.
what am i doing wrong and what should i do to compile luajit?
any help appriciated!
Required steps to build using Visual Studio 2010:
open VS 2010 command prompt window
set up appropriate VS environment: e.g. vcvarsall.bat x64 (for 64-bit) or vcvarsall.bat x86 (for 32-bit)
go to luajit src directory: e.g. cd \projects\luajit\src
start the build: msvcbuild.bat

Compile Delphi 2010 Project with MSBuild

I am trying to compile a Delpho 2010 project using the msbuild tool. Unfortunately when firing the command
msbuild Delphi.dproj
it returns the error code MSB4040, which means that there is no target in the project.
So far a RAD Delphi 2010 environment is still installed on the machine. Does anybody know which files do I need to compile the project without the RAD environment installed?
Thanks in advance
Dennis
Looks like you need following files to get Delphi 2010 compiling process run without RAD Studio installed:
The complete lib folder including the Indy10 folder (if you want to use Indy)
lib
lib\Indy10
And the following files from the bin folder
bin\Borland.Build.Tasks.Common.dll
bin\Borland.Build.Tasks.Delphi.dll
bin\Borland.Build.Tasks.Shared.dll
bin\Borland.Globalization.dll
bin\CodeGear.Common.Targets
bin\CodeGear.Delphi.Targets
bin\DCC32.EXE
bin\lnkdfm140.dll
bin\rlink32.dll
I hope this is the minimal set of needed files.
I had a similar problem and found out that you have to call msbuild from the project-folder instead of the installation folder of msbuild.
...where calling
C:\Windows\Microsoft.NET\Framework\v2.0.50727>msbuild D:\\...\TestProject.dprj
would throw some strange errors, calling
D:\\...\\TestProject>msbuild TestProject.dprj
would work fine for me.

error PRJ0003 : Error spawning 'cl.exe'

I converted VS2006 vc++ project to VS2008. When compiling I get the above error. How do i fix it? am I missing this exe ?
There is a bug in the Visual Studio 2008 Standard Edition installer. It does not install cl.exe if you only install Visual C++ but not Visual C#. To work around this you have to install Visual C# even if you do not need this.
cl.exe is VS2008 (and any other VS) C/C++ compiler, so check for more detailed error message why it cannot be spawned. Be sure you've installed C++ language support when installing VS2008.
It could be that your "path" environment variable does not contain the path to the folder where cl.exe is located.
Another possible reason could be that when installing VS2008, you did not select the option to install the Win32 tools (which include the command line compiler).
In any case, you may want to try to repair the installation of VS2008 (by running its setup via Control Panel - Add/Remove Programs), or use its "Add/Remove components" option and add the "Win32 tools" option (under Visual C++ - Visual C++ Tools).
I had this problem under Windows 10 and solved it by adding the following paths to the PATH environment variable:
C:\ProgramFilesC\VS2008\Common7\IDE
C:\ProgramFilesC\VS2008\VC\bin\x86_amd64
where C:\ProgramFilesC\VS2008 is the path where I installed Visual Studio.
Actually this error occurs because of path is not correctly set.
Goto Tools>Options>Directories> show directories for > Select Executable files
Here copy the path address from the folder where you installed and paste that path address
G:\Program files\vb (visual basic) 6.0\Visual Basic 6.0\VC98\BIN
then click OK.
This may work for you.

Resources