'Cannot open program database' problem in Windows docker container - docker

I use ninja as the build tool of cmake, ninja build parallelly. When build in the physical machine, it compiles without any problem, but in a Windows docker container, it reports:
fatal error C1041: cannot open program database 'blabla.pdb'; if multiple CL.EXE write to
the same .PDB file, please use /FS
The compiler is MSVC 2015, but the /FS seems a 2012 or 2013 option, after add /FS to the CXX flags:
The C++ compiler
"C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe"
is not able to compile a simple test program.
It compiles without problem if I just use one core.
I have searched the web for a long time, but no useful information found.

Related

How to build Delphi project in Linux through makefile?

I am trying to port an application written in delphi from windows 32 bit to Linux 64 bit.
Using PAServer I can compile and building the application through Rad Studio.
But Here I am using Makefiles to compile and build in order to achieve automation using jenkins.
In windows the makefile is using few executables from Rad Studio like cgrc.exe , dcc32.exe, bcc32.exe and cl.exe to build the application.
So , what could be the suitable alternative or option for those executables to build my application in Linux through makefile (using jenkins).
Any help on this is appreciated.

OpenCV build on Windows Visual Studio error: 'setlocal' is not recognized as an internal or external command

I am building OpenCV source code on Windows 10 with Visual Studio 2015, but encounter an strange error.
First of all, I configured the source code with CMake. After configuration successfully done, I opened the configured OpenCV solution with VS2015 and press F7 to build. However, seems that every project being built encounter following error caused by 'setlocal' is not recognized.
6>------ Build started: Project: IlmImf, Configuration: Debug x64 ------
6> 'setlocal' is not recognized as an internal or external command,
6> operable program or batch file.
Things are strange because previously I also built OpenCV source code on Win10 with VS2015 and there was no any such kind of error before. But not know why this error appears now.
How do resolve this error?

How do I test the WDK 8.1 scanner file system minifilter driver sample?

I downloaded the WDK 8.1 and samples and using Win 7 Debug Win32 build configuration while building with Visual Studio 2013 for the "Scanner File System Minifilter Driver" sample solution. It successfully built the solution.
The build output 3 files of interest to me:
1) scanner.sys (the scanner file system minifilter driver)
2) scanuser.exe (the user-land executable that talked to the driver)
3) scanner.inf (driver installation file)
I copied the files over to my VMware virtual machine (XP 32-bit, in this case) and installed the driver using the .inf file which put the appropriate registry keys in the registry and put a copy of the .sys file into C:\Windows\System32\drivers. Then I ran "net start scanner" which started the driver successfully.
So far, this all worked fine. However ...
When I ran the scanuser.exe file it says it's not a valid Win32 application.
How do I go about testing this if I can't run the executable?
Are there build options I have to set in order for this to work?
Out of the box, Visual Studio 2013 will not produce executable that will run on Windows XP.
You must change the platform toolset:
In the Property Pages dialog box for the project, under Configuration Properties, General, set the Platform Toolset property to the desired Windows XP toolset. For example, choose Visual Studio 2012 – Windows XP (v110_xp) to create code that is binary compatible with the Microsoft Visual C++ 2012 Redistributable libraries.
In a similar project, I used the Visual Studio 2010 toolset.

TFS 2012 + VS 2013 + Microsoft Fakes compile issue (only during TFSBuild)

We are using TFS 2012 (Update 3) and VS 2013 RC. We have a .sln file with a two projects - the main project / assembly, and a UnitTest project. The unit test project is leveraging Microsoft Fakes. Within Visual Studio (we are using Premium), I can compile the .sln and run the tests. On the build agent, I can use Visual Studio to compile and build the .sln and run the tests. But when we queue a build, it fails to build the UnitTest project because it can't find the Fakes assembly. It doesn't appear to be dynamically creating it like it does when you build in Visual Studio. Typically in VS is creates the fakes dll and puts it in the FakeAssemblies folder. After the build fails, I can log in and see it did not create a FakeAssemblies directory at all.
The error is...
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets (1605): Could not resolve this reference. Could not locate the assembly "System.Web.Http.5.0.0.0.Fakes". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
Our build is using the default template - and we have selected to build the .sln (which has the main assembly and the unit test project). Should we not be including the UnitTest in that .sln? Is there some other way the UnitTest should be getting compiled during the build?
Does anyone know why the build wouldn't by creating the Fake assembly dynamically like Visual Studio does?
Thanks!!!
I had the same issue but with TFS 2012 and VS 2012 and solved it by installing Visual Studio in TFS Server. So if you've already installed VS there, this advice won't help you.
First, I tried to copy that assembly from the folder in my local machine to the same folder in the TFS server. It's located in c:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PublicAssemblies\Microsoft.QualityTools.Testing.Fakes.dll.
The problem was solved, a test project was built successfully, but each test that were using Fakes were not passed. There was an exception:
Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationException:
UnitTestIsolation instrumentation failed to initialize. Please restart
Visual Studio and rerun this test.
I did not have time and decided to make the second step and installed Visual Studio in TFS machine and all problems disappeared

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

Resources