"Required package rtl not found" when building with Hudson - delphi

I am trying to get Hudson to work with my Delphi project. I am using the following batch file to build my project (as suggested in this blog post):
call "C:\Program Files\Embarcadero\RAD Studio\8.0\bin\rsvars.bat"
msbuild /p:Win32LibraryPath="$(BDS)\lib;$(BDS)\lib\win32\release;$(BDS)\lib\win32\debug;$(BDSUSERDIR)\Imports;$(BDS)\Imports;$(BDSCOMMONDIR)\Dcp;$(BDS)\include;" /t:build /p:config=Debug /verbosity:detailed "MyProject\src\MyProject.dproj"
if errorlevel 1 exit 1
I always end up with the error
Embarcadero Delphi for Win32 compiler version 22.0
Copyright (c) 1983,2010 Embarcadero Technologies, Inc.
Fatal: E2202 Required package 'rtl' not found
I don't understand this as rtl.dcp is in "$(BDS)\lib\win32\release" which is on the library path. I am using runtime packages by the way.
Any hints what I can do to solve this?
Edit It seems that the paths do not end up in the command line, which looks something like (after removing project-specific paths):
C:\Program Files\Embarcadero\RAD Studio\8.0\bin\dcc32.exe -$O- -$W+ --inline:off -$A4 -$R+ -$Q+ --doc --no-config -B -LUrtl;vcl;ReportingR;ComponentsR -Q -AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE -DDEBUG;CONSTRAINT_CHECKING;_VER6;EUREKALOG_VER6;EurekaLog -V -VN -GD --drc -W-SYMBOL_DEPRECATED -W-SYMBOL_PLATFORM -W-UNIT_PLATFORM -W-UNIT_DEPRECATED Myproject.dpr

I found the answer in a comment to the original blog post. It turns out that in Delphi XE they changed the name of the Win32LibraryPath property to DelphiWin32LibraryPath. Changing the batch script accordingly fixes the issue.

The first path $(BDS)\Lib for XE,XE2 and XE 10.2 should be change for $(BDSLIB)\$(PLATFORM)\release

Related

MSBuild Windows Kits 10 error with objidl.idl

Trying to build my solution with MSBuild 15.0 from TFS2017 server, I have the following errors:
C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um\objidl.idl (702, 0)
C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um\objidl.idl(702,0): Error MIDL2072: inapplicable attribute : [ Type 'SNB' ( Interface 'IStorage' ) ]
and
C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um\objidl.idl (742, 0)
C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um\objidl.idl(742,0): Error MIDL2072: inapplicable attribute : [ Type 'SNB' ( Parameter 'snbExclude' ) ]
I have tried different versions of \include, \lib, \bin folders such as:
10.0.17134.0
10.0.16299.0
10.0.10586.0
10.0.10240.0
to no avail.
Any ideas or help how to resolve this issue are highly appreciated!
Thanks
First please make sure your local environment is as same as your build agent/server environment.
Besides, also take a look at this similar question, which maybe helpful to you:
error MIDL2072: inapplicable attribute : [annotation] [ Type 'SNB' ( Interface 'IStorage' )
Give a try with the solution mentioned in the link:
Remove all references on older SDK's binary directories in 'Executable
Directories' for 'VC++ Directories' in Properties for
'Microsoft.Cpp.x64.user'; otherwise the wrong (previous) version of
the MIDL compiler (that doesn't understand newer SAL/MIDL syntax) will
run with possible errors.

Delphi MSBuild.exe error MSB4057 but can use IDE build project

I use Delphi XE4 on Windows7 and use Microsoft.NET/Framework/V3.5/MSBuild.exe .
I have added the MSBuild path to the environment variable.
But got this error :(
$MSBuild.exe Project3.dproj /target:Build /property:configutation=Debug
Microsoft (R) Build Engine Version 3.5.30729.5420
[Microsoft .NET Framework, Version 2.0.50727.8762]
Copyright (C) Microsoft Corporation 2007. All rights reserved.
Build started 2017/10/30 ▒W▒▒ 10:45:40.
Project "C:\DXE4_LangDLL\Project3.dproj" on node 0 (Build target(s)).
C:\DXE4_LangDLL\Project3.dproj : error MSB4057: The target "Build" does not exist in the project.
Done Building Project "C:\DXE4_LangDLL\Project3.dproj" (Build target(s)) -- FAILED.
Build FAILED.
"C:\DXE4_LangDLL\Project3.dproj" (Build target) (1) ->
C:\DXE4_LangDLL\Project3.dproj : error MSB4057: The target "Build" does not exist in the project.
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.00
I tried use Microsoft.NET/Framework/V2.0.50727/MSBuild.exe and got the same message.
I was confuse because used Delphi IDE to build project successfully.
Can someone help me?
You have to set first the environmental variables. There is a batch file, at the path
C:\Program Files (x86)\Embarcadero\Studio\XX\rsvars.bat
that i use for command-line batch files, where XX the version of your RAD Studio.
I am not sure if it will work for Git bash as it is, but you can create a batch file that will combine the lines of rsvars.bat and the MSBuild line, and execute it
Something like:
#SET BDS=C:\Program Files (x86)\Embarcadero\Studio\XX
#SET BDSINCLUDE=C:\Program Files (x86)\Embarcadero\Studio\XX\include
#SET BDSCOMMONDIR=C:\Users\Public\Documents\Embarcadero\Studio\XX
#SET FrameworkDir=C:\Windows\Microsoft.NET\Framework\v3.5
#SET FrameworkVersion=v3.5
#SET FrameworkSDKDir=
#SET PATH=%FrameworkDir%;%FrameworkSDKDir%;C:\Program Files (x86)\Embarcadero\Studio\XX\bin;C:\Program Files (x86)\Embarcadero\Studio\XX\bin64;C:\Users\Public\Documents\Embarcadero\InterBase\redist\InterBaseXE3\IDE_spoof;%PATH%
#SET LANGDIR=EN
#SET PLATFORM=
#SET PlatformSDK=
$MSBuild.exe Project3.dproj /target:Build /property:configutation=Debug

Delphi Seattle, Compile Error: F2051 Unit System.SysUtils was compiled with a different version of "".GetMappedFileName

since some days, something weird happened.
Problem:
I always get "Compile Error: F2051 Unit System.SysUtils was compiled
with a different version of “”.GetMappedFileName" No precise code line
to mention. Also the same problem if I make a simple project with
only one call to a sysutils command.
Our situation: me and my collegueare developping on the same project. We use JEDI to exchange our sources and to keep track of changes.
LAst, I was downloading his changed sources. Everything went well and I was ready to go on.
I refreshed all my files and tried to compile, build and run the new sources on my computer.
Then it got weird. While compiling, I got this error:
F2051 Unit System.SysUtils was compiled with a different version of "".GetMappedFileName
I checked our versions of delphi standard lib's and also the versions of our other components installed and everything matches.
Then I went on internet-tip-shopping. I found some similar problems, but non of the possible solutions worked for me...
This are some things I tried yet:
setup a smal simple project with only the beep-function from sysUtils
repair of delphi Seattle
Looked at my Library path, browsing path, ...
Cleared the dcu's of my project
I also tried a "dir /s" search to find different (wrong?) versions of System.SysUtils.*
Found .PAS
1 for every installed version, 14, 15, 16, 17 (non of the 14, 15, or
16 in my paths
C:\ProgramData{0DE47792-19BD-4AF4-B9CF-6378FBA44825}\sourcefileswin32\E1F130EB\D08CA8BE
C:\Users\All
Users{0DE47792-19BD-4AF4-B9CF-6378FBA44825}\sourcefileswin32\E1F130EB\D08CA8BE
Found .DCU
For all versions (14, 15, 16, 17)
For every export system (android, ios, ..)
Also in the ProgramData
Also in the All Users
You an find my library and browsing path at the end of this post.
Some of the internet sites I used to try to solve this:
Why are my units "compiled with a different version" of my own files?
F2051: Unit %s was compiled with a different version of %s
https://translate.google.com/translate?hl=en&sl=auto&tl=en&u=http%3A%2F%2Fdelphi4arab.net%2Fforum%2Fshowthread.php%3Fmode%3Dlinear%26tid%3D4700%26pid%3D24332
[DCC Fatal Error]: F2051 Unit ApFileIO was compiled with a different version of ***.{ApCollections}TLinkList<uPublic.TApObject>
Does anyone have an idea or a clue to get out off this. Cause I can't go on with any of my projects since this happened.
This is my Library path for Win32:
$(BDS)\Imports;
$(BDS)\LIB;
$(BDS)\Bin;
$(BDSCOMMONDIR)\Bpl;
$(BDSCOMMONDIR)\Dcp;
$(BDS)\include;
C:\Program Files (x86)\Neos Eureka S.r.l\EurekaLog 7\Lib\Common\;
C:\Program Files (x86)\Neos Eureka S.r.l\EurekaLog 7\Lib\Win32\Release\Studio23\;
C:\Program Files (x86)\Neos Eureka S.r.l\EurekaLog 7\Source\Extras;
$(BDS)\RBuilder\Lib\Win32;
C:\sources\Utilities;
C:\Program Files (x86)\Embarcadero\synaps\source\lib;
C:\Program Files (x86)\Embarcadero\Components;
C:\Program Files (x86)\Embarcadero\EmbeddedWB\Source;
C:\Program Files (x86)\Embarcadero\Ruler;
C:\Program Files (x86)\Embarcadero\paxCompilerXE10\package;
C:\Program Files (x86)\Embarcadero\Studio\17.0\source\rtl\win;
C:\Program Files (x86)\Devart\UniDAC for RAD Studio 10\Lib\Win32;
c:\program files (x86)\embarcadero\tms pack for firemonkey\win32;
C:\Program Files (x86)\Embarcadero\fgx_XE8\Library;$(DXVCL)\Library\RS23;
C:\Program Files (x86)\Embarcadero\RTC;
C:\Program Files (x86)\Embarcadero\Studio\17.0\lib\win32\release
This is my browsing path:
$(BDS)\source\rtl;
$(BDS)\SOURCE\RTL\SYS;
$(BDS)\source\rtl\win;
$(BDS)\source\rtl\common;
$(BDS)\SOURCE\VCL;
$(BDS)\SOURCE\XML;
$(BDS)\source\ToolsAPI;
$(BDS)\SOURCE\PROPERTY EDITORS;
$(BDS)\source\Internet;
$(BDS)\SOURCE\VCL\AppAnalytics;
$(BDS)\SOURCE\IBX;
$(BDS)\source\soap;
$(BDS)\source\Indy10\Core;
$(BDS)\source\Indy10\System;
$(BDS)\source\Indy10\Protocols;
$(BDS)\source\fmx;
$(BDS)\source\databinding\components;
$(BDS)\source\databinding\engine;
$(BDS)\source\databinding\graph;
$(BDS)\source\data;
$(BDS)\source\data\ado;
$(BDS)\source\data\bde;
$(BDS)\source\data\cloud;
$(BDS)\source\data\datasnap;
$(BDS)\source\data\dbx;
$(BDS)\source\data\dsnap;
$(BDS)\source\data\Test;
$(BDS)\source\data\vclctrls;
$(BDS)\source\data\datasnap\connectors;
$(BDS)\source\data\datasnap\proxygen;
$(BDS)\source\DataExplorer;
$(BDS)\source\DUnit\Contrib\DUnitWizard\Source\Common;
$(BDS)\source\DUnit\Contrib\DUnitWizard\Source\Common\dunit;
$(BDS)\source\DUnit\Contrib\DUnitWizard\Source\DelphiExperts\Common;
$(BDS)\source\DUnit\Contrib\DUnitWizard\Source\DelphiExperts\DUnitProject;
$(BDS)\source\DUnit\Contrib\DUnitWizard\Source\DelphiExperts\DUnitProject\dunit;
$(BDS)\source\DUnit\src;
$(BDS)\source\DUnit\tests;
$(BDS)\source\Experts;
$(BDS)\source\indy\abstraction;
$(BDS)\source\indy\implementation;
$(BDS)\source\indyimpl;
$(BDS)\source\LiveTile;
$(BDS)\source\Property Editors\Indy10;
$(BDS)\source\soap\wsdlimporter;
$(BDS)\source\Visualizers;
$(BDS)\source\xtab;
$(BDS)\source\DUnit\Contrib\XMLReporting;
$(BDS)\source\DUnit\Contrib\XPGen;
$(BDS)\source\data\rest;
$(BDS)\source\data\firedac;
$(BDS)\source\tethering;
$(BDS)\source\DUnitX;
$(BDS)\source\data\ems;
$(BDS)\source\rtl\net;
$(BDS)\source\FlatBox2D;
$(BDS)\OCX\Servers;
C:\Program Files (x86)\Neos Eureka S.r.l\EurekaLog 7\Source\;
$(DXVCL)\ExpressCore Library\Sources;
$(DXVCL)\XP Theme Manager\Sources;
$(DXVCL)\ExpressGDI+ Library\Sources;
$(DXVCL)\ExpressCommon Library\Sources;
$(DXVCL)\ExpressLibrary\Sources;
$(DXVCL)\ExpressPageControl\Sources;
$(DXVCL)\ExpressDataController\Sources;
$(DXVCL)\ExpressEditors Library\Sources;
$(DXVCL)\ExpressWizard Control\Sources;
$(DXVCL)\ExpressBars\Sources;
$(DXVCL)\ExpressDocking Library\Sources;
$(DXVCL)\ExpressLayout Control\Sources;
$(DXVCL)\ExpressSpreadSheet\Sources;
$(DXVCL)\ExpressExport Library\Sources;
$(DXVCL)\ExpressQuantumTreeList\Sources;
$(DXVCL)\ExpressQuantumGrid\Sources;
$(DXVCL)\ExpressVerticalGrid\Sources;
$(DXVCL)\ExpressMemData\Sources;
$(DXVCL)\ExpressSpellChecker\Sources;
$(DXVCL)\ExpressTile Control\Sources;
$(DXVCL)\ExpressNavBar\Sources;
$(DXVCL)\ExpressSkins Library\Sources;
$(DXVCL)\ExpressPrinting System\Sources;
$(DXVCL)\ExpressPivotGrid\Sources;
$(DXVCL)\ExpressDBTree Suite\Sources;
$(DXVCL)\ExpressOrgChart\Sources;
$(DXVCL)\ExpressFlowChart\Sources;
$(DXVCL)\ExpressMap Control\Sources;
$(DXVCL)\ExpressScheduler\Sources;
$(DXVCL)\ExpressRichEdit Control\Sources;
$(DXVCL)\ExpressGauge Control\Sources
Problem solved, There was one instance in the library path that was responsible for the problem.
I disabled "C:\Program Files (x86)\Embarcadero\Studio\17.0\source\rtl\win;" from the library and all seems to work now.
My job now is to look why this file was in my library from my predecessor and try to look if there are any "strange" pas/dcu files in that directory so it should be needed in the path.
But that is now my job, Thx to all who helped me with sending some clues to get it solved.
So, it looks that I lost a lot of time by searching at other things
first instead of disabling 1 by 1 of the instances in my Library path.
This is the tip for today :-)

How to integrate LuaJIT with LuaRocks on Windows?

I downloaded the source of LuaJIT and compiled it with msvc120.dll (VS 2013 x64). When I run it from the command line I have no problems executing some basic lua. Now the LuaJIT installation guide mentions moving luajit.exe and lua51.dll into their own folder. From there it says to create a lua folder and under that a jit folder with the contents of src/jit moved underneath the newly created jit folder.
From my understanding my folder should look like and contain:
luajit.exe
lua51.dll
/lua
/jit
bc.lua
[rest of jit files]
vmdef.lua
Is this correct or am I missing files?
Now after I built my luajit I tried to wire it up into my luarocks to act as my interpreter using
install.bat /LUA C:\LuaJIT\2.0.3\[folder with above content]
However this cannot find the header files. I then copied over what are the header files into the folder above and that wires it up, but I can never actually get anything to compile when pointed over to LuaJIT. Edit: The error I get is the following,
C:\LuaJIT\2.0.3\bin\lua51.dll : fatal error LNK1107: invalid or corrupt file: cannot read at 0x2D0
Error: Failed installing dependency: https://rocks.moonscript.org/luafilesystem-1.6.2-2.src.rock - Build error: Failed compiling module lfs.dll
Is the correct way to handle this to simply point to my lua binaries and from there leverage LuaJIT to run my files or am I doing something wrong with wiring up LuaJIT and luarocks? The former seems to work for the most part, since I only ran into one library compilation issue, lua-cjson.
I've run on exactly the same problem, but they've found a solution right here:
https://github.com/keplerproject/luafilesystem/issues/22
I knew that for "linking DLLs statically" there is a so-called "export" .lib file, which is passed to the linker (and not the DLL itself).
So, for example, when compiling, LuaRocks was doing this:
cl /nologo /MD /O2 -c -Fosrc/mime.obj -ID:/LuaJIT-2.0.4/include/ src/mime.c -DLUA_COMPAT_APIINTCASTS -DLUASOCKET_DEBUG -DNDEBUG -DLUASOCKET_API=__declspec(dllexport) -DMIME_API=__declspec(dllexport) mime.c
link -dll -def:core.def -out:mime/core.dll D:/LuaJIT-2.0.4/bin/lua51.dll src/mime.obj
My LuaJIT was compiled from source in D:\LuaJIT-2.0.4\src, but I made two folders myself: D:\LuaJIT-2.0.4\include with all *.h files copied from src and D:\LuaJIT-2.0.4\bin with luajit.exe, lua51.dll, and then later lua51.exp and lua51.lib. Still same error, but this was the right track.
Fix
Now, check where your LuaRocks configs are:
luarocks.bat help
Scroll down to a section like:
CONFIGURATION
Lua version: 5.1
Configuration files:
System: D:/luarocks/config-5.1.lua (ok)
User : (... snip ...)
Edit the System configuration file, specifically see the part:
variables = {
MSVCRT = 'VCRUNTIME140',
LUALIB = 'lua51.dll'
}
Here! LUALIB should be the .lib file. If your export lib is alongside the DLL, you just need to change to:
variables = {
MSVCRT = 'VCRUNTIME140',
LUALIB = 'lua51.lib' -- here!
}
Verification
And now:
luarocks.bat install luasocket
(...)
link -dll -def:core.def -out:socket/core.dll D:/LuaJIT-2.0.4/bin/lua51.lib src/luasocket.obj (...)
(...)
luasocket 3.0rc1-2 is now built and installed in D:\luarocks\systree (license: MIT)
Note the first argument passed to the linker.

CMake Generated Eclipse CDT Project Does Not Have System Includes

My problem is similar with this: http://www.eclipse.org/forums/index.php/m/649323/
I created a cmake project, and used
cmake .. -G "Eclipse CDT4 - Unix Makefiles"
to create a Eclipse CDT4 project.
But in the CDT IDE, the standard include paths are not listed, and all STL or system build-in header files include directives are marked as "cannot be resolved", so the "Open Declaration" or other a lot of operation cannot be done.
However, I could compile it without any problems.
My co-worker also has a cmake project, but it's very complicated. The CDT project generated from his cmake project DOES have the system includes. But his cmake is way too complicated, and he told me that he didn't do anything special to include the system paths.
Can anyone help me out? Thanks.
My Main CMakeLists.txt:
CMake_Minimum_Required(VERSION 2.8)
# Some settings
Set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
CMake_Policy(SET CMP0015 NEW)
#Include(CMakeProcedures.cmake)
#CheckEnvironment()
# Set the compiler and its version if needed
# Create the project
Project(MyProjectName CXX)
# Set the compiler
Set(CMAKE_CXX_COMPILER /usr/bin/g++)
# Detect whether we are in-source
If (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
Message(FATAL_ERROR "In-source building is not allowed! Please create a 'build' folder and then do 'cd build; cmake ..'")
EndIf()
# Set the output dirs
Set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
Set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
# Add source subdirs to the build
Add_Subdirectory(src)
# Add_Subdirectory(test EXCLUDE_FROM_ALL)
Peter
One workaround is to manually add these to the CDT IDE:
/usr/include/c++/4.5
/usr/include/c++/4.5/backward
/usr/include/c++/4.5/i686-linux-gnu
/usr/include/i386-linux-gnu
/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/include
/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/include-fixed
/usr/local/include
But it's not the solution.
I finally figured out that this line is causing the problem:
Project(MyProjectName CXX)
If we remove the optional paramter CXX, life is good.
Can anyone tell me why?
Peter

Resources