How do I build a VSSolution for ReactOS?

Ask your support questions in here

Moderator: Moderator Team

Post Reply
Fraizeraust
Posts: 228
Joined: Thu Jan 05, 2017 11:46 am
Location: Italy
Contact:

How do I build a VSSolution for ReactOS?

Post by Fraizeraust » Mon Mar 25, 2019 11:02 am

I'm trying to build a VSSolution for ReactOS, specifically for On-Screen Keyboard so that I can build a solution for this program and acquire debugging capabilities. I do both have RosBE 2.1.6 and Visual Studio (mine's Community 2017) in order to proceed with the steps.

To begin with, I added the PROJECT(OSK) statement on CMakeLists.txt file with the name indicating that the solution is related to On-Screen Keyboard. When I opened the VS Developer command prompt and typed configure.cmd VSSolution CMake couldn't find GCC and C++ compiler for some reason.
Here's the output:

Code: Select all

**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.9.9
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community>E:

E:\>cd ReactOS\Fork\reactos

E:\ReactOS\Fork\reactos>configure.cmd VSSolution
Detected Visual Studio Environment VS15-i386
Creating directories in output-VS-i386-sln
Preparing reactos...
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:25 (project):
  The CMAKE_C_COMPILER:

    cl

  is not a full path and was not found in the PATH.



CMake Error at CMakeLists.txt:25 (project):
  The CMAKE_CXX_COMPILER:

    cl

  is not a full path and was not found in the PATH.



-- Configuring incomplete, errors occurred!
See also "E:/ReactOS/Fork/reactos/output-VS-i386-sln/CMakeFiles/CMakeOutput.log"
.
See also "E:/ReactOS/Fork/reactos/output-VS-i386-sln/CMakeFiles/CMakeError.log".


E:\ReactOS\Fork\reactos>
Here's the CMake version output:

Code: Select all

E:\ReactOS\Fork\reactos>cmake --version
cmake version 3.2.1-ReactOS

CMake suite maintained and supported by Kitware (kitware.com/cmake).

E:\ReactOS\Fork\reactos>
And here's the output of CMakeError.log:

Code: Select all

Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: cl 
Build flags: 
Id flags: 

The output was:
1
Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 25/03/2019 09:36:34.
Project "E:\ReactOS\Fork\reactos\output-VS-i386-sln\CMakeFiles\3.2.1-ReactOS\CompilerIdC\CompilerIdC.vcxproj" on node 1 (default targets).
PrepareForBuild:
  Creating directory "Debug\".
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(402,5): warning MSB8038: Spectre mitigation is enabled but Spectre mitigated libraries are not found.  Verify that the Visual Studio Workload includes the Spectre mitigated libraries.  See https://aka.ms/Ofhn4c for more information. [E:\ReactOS\Fork\reactos\output-VS-i386-sln\CMakeFiles\3.2.1-ReactOS\CompilerIdC\CompilerIdC.vcxproj]
  Creating directory "Debug\CompilerIdC.tlog\".
InitializeBuildStatus:
  Creating "Debug\CompilerIdC.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\CL.exe /c /nologo /W0 /WX- /diagnostics:classic /Od /Oy- /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Qspectre /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"Debug\\" /Fd"Debug\vc141.pdb" /Gd /TC /analyze- /FC /errorReport:queue CMakeCCompilerId.c
  CMakeCCompilerId.c
Link:
  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\link.exe /ERRORREPORT:QUEUE /OUT:".\CompilerIdC.exe" /INCREMENTAL:NO /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /PDB:".\CompilerIdC.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:".\CompilerIdC.lib" /MACHINE:X86 /SAFESEH Debug\CMakeCCompilerId.obj
LINK : fatal error LNK1104: cannot open file 'MSVCRTD.lib' [E:\ReactOS\Fork\reactos\output-VS-i386-sln\CMakeFiles\3.2.1-ReactOS\CompilerIdC\CompilerIdC.vcxproj]
Done Building Project "E:\ReactOS\Fork\reactos\output-VS-i386-sln\CMakeFiles\3.2.1-ReactOS\CompilerIdC\CompilerIdC.vcxproj" (default targets) -- FAILED.

Build FAILED.

"E:\ReactOS\Fork\reactos\output-VS-i386-sln\CMakeFiles\3.2.1-ReactOS\CompilerIdC\CompilerIdC.vcxproj" (default target) (1) ->
(PrepareForBuild target) -> 
  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(402,5): warning MSB8038: Spectre mitigation is enabled but Spectre mitigated libraries are not found.  Verify that the Visual Studio Workload includes the Spectre mitigated libraries.  See https://aka.ms/Ofhn4c for more information. [E:\ReactOS\Fork\reactos\output-VS-i386-sln\CMakeFiles\3.2.1-ReactOS\CompilerIdC\CompilerIdC.vcxproj]


"E:\ReactOS\Fork\reactos\output-VS-i386-sln\CMakeFiles\3.2.1-ReactOS\CompilerIdC\CompilerIdC.vcxproj" (default target) (1) ->
(Link target) -> 
  LINK : fatal error LNK1104: cannot open file 'MSVCRTD.lib' [E:\ReactOS\Fork\reactos\output-VS-i386-sln\CMakeFiles\3.2.1-ReactOS\CompilerIdC\CompilerIdC.vcxproj]

    1 Warning(s)
    1 Error(s)

Time Elapsed 00:00:02.74


Checking whether the C compiler is IAR using "" did not match "IAR .+ Compiler":
Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27027.1 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

usage: cl [ option... ] filename... [ /link linkoption... ]
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: cl 
Build flags: 
Id flags: 

The output was:
1
Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 25/03/2019 09:36:37.
Project "E:\ReactOS\Fork\reactos\output-VS-i386-sln\CMakeFiles\3.2.1-ReactOS\CompilerIdCXX\CompilerIdCXX.vcxproj" on node 1 (default targets).
PrepareForBuild:
  Creating directory "Debug\".
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(402,5): warning MSB8038: Spectre mitigation is enabled but Spectre mitigated libraries are not found.  Verify that the Visual Studio Workload includes the Spectre mitigated libraries.  See https://aka.ms/Ofhn4c for more information. [E:\ReactOS\Fork\reactos\output-VS-i386-sln\CMakeFiles\3.2.1-ReactOS\CompilerIdCXX\CompilerIdCXX.vcxproj]
  Creating directory "Debug\CompilerIdCXX.tlog\".
InitializeBuildStatus:
  Creating "Debug\CompilerIdCXX.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\CL.exe /c /nologo /W0 /WX- /diagnostics:classic /Od /Oy- /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Qspectre /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"Debug\\" /Fd"Debug\vc141.pdb" /Gd /TP /analyze- /FC /errorReport:queue CMakeCXXCompilerId.cpp
  CMakeCXXCompilerId.cpp
Link:
  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\link.exe /ERRORREPORT:QUEUE /OUT:".\CompilerIdCXX.exe" /INCREMENTAL:NO /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /PDB:".\CompilerIdCXX.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:".\CompilerIdCXX.lib" /MACHINE:X86 /SAFESEH Debug\CMakeCXXCompilerId.obj
LINK : fatal error LNK1104: cannot open file 'MSVCRTD.lib' [E:\ReactOS\Fork\reactos\output-VS-i386-sln\CMakeFiles\3.2.1-ReactOS\CompilerIdCXX\CompilerIdCXX.vcxproj]
Done Building Project "E:\ReactOS\Fork\reactos\output-VS-i386-sln\CMakeFiles\3.2.1-ReactOS\CompilerIdCXX\CompilerIdCXX.vcxproj" (default targets) -- FAILED.

Build FAILED.

"E:\ReactOS\Fork\reactos\output-VS-i386-sln\CMakeFiles\3.2.1-ReactOS\CompilerIdCXX\CompilerIdCXX.vcxproj" (default target) (1) ->
(PrepareForBuild target) -> 
  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(402,5): warning MSB8038: Spectre mitigation is enabled but Spectre mitigated libraries are not found.  Verify that the Visual Studio Workload includes the Spectre mitigated libraries.  See https://aka.ms/Ofhn4c for more information. [E:\ReactOS\Fork\reactos\output-VS-i386-sln\CMakeFiles\3.2.1-ReactOS\CompilerIdCXX\CompilerIdCXX.vcxproj]


"E:\ReactOS\Fork\reactos\output-VS-i386-sln\CMakeFiles\3.2.1-ReactOS\CompilerIdCXX\CompilerIdCXX.vcxproj" (default target) (1) ->
(Link target) -> 
  LINK : fatal error LNK1104: cannot open file 'MSVCRTD.lib' [E:\ReactOS\Fork\reactos\output-VS-i386-sln\CMakeFiles\3.2.1-ReactOS\CompilerIdCXX\CompilerIdCXX.vcxproj]

    1 Warning(s)
    1 Error(s)

Time Elapsed 00:00:01.16


Checking whether the CXX compiler is IAR using "" did not match "IAR .+ Compiler":
Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27027.1 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

usage: cl [ option... ] filename... [ /link linkoption... ]
Why CMake automatically chooses cl as the main compiler for C/C++? My PATH variable looks like E:\ReactOS\RosBE\bin which it has been added by the RosBE installer itself.

binarymaster
Posts: 271
Joined: Sun Nov 16, 2014 7:05 pm
Location: Russia, Moscow
Contact:

Re: How do I build a VSSolution for ReactOS?

Post by binarymaster » Mon Mar 25, 2019 1:22 pm

Fraizeraust wrote:
Mon Mar 25, 2019 11:02 am
When I opened the VS Developer command prompt and typed configure.cmd VSSolution CMake couldn't find GCC and C++ compiler for some reason.
To use GCC compiler you should not use VS command prompt, but just default RosBE command prompt.
Fraizeraust wrote:
Mon Mar 25, 2019 11:02 am
Why CMake automatically chooses cl as the main compiler for C/C++? My PATH variable looks like E:\ReactOS\RosBE\bin which it has been added by the RosBE installer itself.
I don't get your question. Configure script is designed to use Microsoft's compiler (which is cl.exe) when it's started from VS command prompt. :roll:

Fraizeraust
Posts: 228
Joined: Thu Jan 05, 2017 11:46 am
Location: Italy
Contact:

Re: How do I build a VSSolution for ReactOS?

Post by Fraizeraust » Mon Mar 25, 2019 3:07 pm

binarymaster wrote:To use GCC compiler you should not use VS command prompt, but just default RosBE command prompt.
You did not get my point. I want to build a VS Solution for On-Screen Keyboard and that requires VS Developer command prompt.

binarymaster
Posts: 271
Joined: Sun Nov 16, 2014 7:05 pm
Location: Russia, Moscow
Contact:

Re: How do I build a VSSolution for ReactOS?

Post by binarymaster » Mon Mar 25, 2019 3:41 pm

Fraizeraust wrote:
Mon Mar 25, 2019 3:07 pm
You did not get my point. I want to build a VS Solution for On-Screen Keyboard and that requires VS Developer command prompt.
That's ok, but then how GCC is related there?

Fraizeraust
Posts: 228
Joined: Thu Jan 05, 2017 11:46 am
Location: Italy
Contact:

Re: How do I build a VSSolution for ReactOS?

Post by Fraizeraust » Tue Mar 26, 2019 5:34 pm

The problem is now fixed. I had to re-install VS 2017 again with all the VC++ packages and libraries.

bean601
Posts: 1
Joined: Sat Jun 08, 2019 7:50 pm

Re: How do I build a VSSolution for ReactOS?

Post by bean601 » Sat Jun 08, 2019 7:51 pm

What exactly did you need to install? I've installed the VC++ workloads but still seeing the error. Any of the individual packages missing?

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest