Compile Delphi 2010 Project with MSBuild - delphi

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.

Related

RAD Studio 10.2.3 Jedi JVCL Install Problem

I've uninstalled my RAD Studio 10.2.2 and installed 10.2.3 in my Win10 development VM. Along the way I uninstalled all the previous 3rd-party libs, including the Jedi GetIt packages, and per the instructions got rid of all the old Jedi source and DCP/DCLs. I'm attempting to install them back into 10.2.3 via GetIt. The JCL libs install fine, but when I try to install JVCL, the installation batch file hangs after compiling the installer and the VM comes to its knees. I rebooted, started taskmgr and watched as the batch file ran - it appears to go into a loop creating many instances of msgfmt. I've tried removing it all again, downloading and installing the 3.8 version myself and running the install batch file by itself, same problem; then backing up to the 3.6 version that had installed OK in 10.2.2, and it does the same thing. If I edit the batch file to skip the language-setup section, the batch file completes OK, but trying to re-run the GetIt update causes it to re-download and replace that batch file. :(
The installer does compile before the languages part of the batch file is reached, so I tried running the installer directly. I assume I'm not passing it cmd line info it needs, because it compiles the 64-bit libs fine but chokes immediately on compiling the 32-bit version of JvCore250.bpl with an unspecified compile error.
Anyone else run into this? Is a solution known?
Turns out to ultimately be a pathing problem. When multiple installations of the IDE exist on a machine (e.g. my VM has or previously had D2007, XE2 and 10.1 on it), the PATH environment variable can be too long - edit the PATH in the system to remove the old/stale paths. Then make sure that the library paths in the IDE includes $(BDSLIB)\$(PLATFORM)\release or you'll get "can't find RTL" when building the packages.
For me the problem is generated from the msgfmt.exe of dxgettext.
msgfmt.exe generates multilanguage messages, for a multilanguage support of jvcl installation.
For the specific problem of msgfmt.exe try to see this: dxgettext and Windows 10
I resolved the problem opened the install.bat file in jvcl folder, and I commented (with ::) every line where the msgfmt is executed.
Attention:
If you use getit I suppose you have to open the folder where jvcl is downloaded and search install.bat (I didn't use getit)
Instead I downloaded jvcl directly from github in my component folder, and I did what is written above in that folder.

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

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

Error: The imported project "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Default.props" was not found

I have migrated a VS2008 solution to VS2013. My solution contains VC++ projets.
I have set the tools platform to v120_xp for each project
My solution compile on my computer and compile on my builds server in VS2013
My builds server is a Windows2008 R2 with VS2008, VS2010 and VS2013 and a build controler of TeamFoundationServer 2010.
When i launch the build with the build controller, the build fails with :
The imported project "C:\Program Files
(x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Default.props" was
not found. Confirm that the path in the declaration is
correct, and that the file exists on disk.
In the V110 directory this file doesn't exist but it exist in the V120 directory.
I have checked the registry :
HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersion\12.0
the VCTargetPath are corrects
Have you an idea to help me?
I have edited the registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MSBuild\ToolsVersions\12.0\11.0
and
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\12.0\11.0
to use the V120 directory
Now my server build the solution, but i don't understand why MSBuild use the key
ToolsVersions\12.0\11.0 and not the key ToolsVersions\12.0\12.0
Parhaps it's due to the v120_xp platform toolset
The true answer is that MSBuild subtracts 1 from the .sln Visual Studio Version. Since you do not have VS 2012 install or you have not installed it, the v11.0 folder is not found. It is all explained by Sayed Ibrahim Hashimi:
http://sedodream.com/PermaLink%2cguid%2ca5894bad-f2a1-441a-a5b2-74f16c6cf8aa.aspx
I came across the same problem in 2015 though, with Windows 10 and Visual Studio 2015 RC (fresh install)
To correct the issue I tried several solutions based on my research ie installing "VS Windows SDK" which didn't do anything different to resolve my problem, I then on another recommendation installed GitHub in order to download MSBuild which is now excluded from VS, I ultimately downloaded and installed "VS Tools for Windows 10" this didn't give me the same error in the end, without having to change registry keys
Installing VS 2012 on your build server should create the necessary targets files for you.
I was able to get past this by changing $(VCTargetsPath) to $(VCTargetsPath12) in the project file.
This feels like a temporary workaround rather than a permanent solution, since once we move to the next version of Visual Studio we'll have to find all the references to $(VCTargetsPath12) and replace with the new target path.

using openCV SVN repository

I want to use openCv 2.2 with Windows Seven, but I found on the web that there is a bug with the web-cam stream on Seven. But this bug is fixed on the SVN repository.
So I would like to know how I can use the sources from the repository and compile a project with it on visual studio 2010. I try it, but I have a compile time error saying "'opencv2/core/core_c.h' : No such file or directory"
Thanks a lot.
Have you tried with the following guideline/tutorial?
http://redkiing.wordpress.com/2010/10/03/opencv-and-visual-studio-2010-with-cmake/

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