Visual Studio2019 compile reactos error

All development related issues welcome

Moderator: Moderator Team

Post Reply
lialong
Posts: 4
Joined: Tue Jan 28, 2020 6:30 pm

Visual Studio2019 compile reactos error

Post by lialong »

Hello, everyone
I try to compile reactos with Visual Studio2019 error
Most of them are such problems
C: \ Program Files (x86) \ Windows Kits \ 10 \ Include \ 10.0.18362.0 \ um \ winbase.h (9406,31): error C3861: "InterlockedExchange64"
Cause compilation error

Microsoft Visual Studio Enterprise 2019
Version 16.4.3

reactos-master (GitHub clone)
Please help
ThFabba
Developer
Posts: 293
Joined: Sun Jul 11, 2010 11:39 am

Re: Visual Studio2019 compile reactos error

Post by ThFabba »

We'll need a little more information to be of any use.
1. Which steps did you use to try to build ROS?
2. What is the exact error? You seem to have cut off the message.
3. At which step of the build does this happen? A complete log of the build process would help.

For reference, here's what I'd recommend doing:
1. Start a Visual Studio Developer Command Prompt (for x86)
2. Add RosBE to your PATH inside the prompt, e.g.: set PATH=%PATH%;C:\Program Files\RosBE\bin
3. Create a build folder, e.g.: mkdir C:\ROS\build-MSVC && cd C:\ROS\build-MSVC
4. Run the configure.cmd script from your git checkout (without the VSSolution argument, to get Ninja build files), e.g.: C:\ROS\source\configure.cmd
5. Run build steps using "ninja" as desired, e.g.: ninja bootcd

If any of these fail, it would be most helpful to have the entire output to see what went wrong.
lialong
Posts: 4
Joined: Tue Jan 28, 2020 6:30 pm

Re: Visual Studio2019 compile reactos error

Post by lialong »

ThFabba wrote: Wed Jan 29, 2020 12:51 am We'll need a little more information to be of any use.
1. Which steps did you use to try to build ROS?
2. What is the exact error? You seem to have cut off the message.
3. At which step of the build does this happen? A complete log of the build process would help.

For reference, here's what I'd recommend doing:
1. Start a Visual Studio Developer Command Prompt (for x86)
2. Add RosBE to your PATH inside the prompt, e.g.: set PATH=%PATH%;C:\Program Files\RosBE\bin
3. Create a build folder, e.g.: mkdir C:\ROS\build-MSVC && cd C:\ROS\build-MSVC
4. Run the configure.cmd script from your git checkout (without the VSSolution argument, to get Ninja build files), e.g.: C:\ROS\source\configure.cmd
5. Run build steps using "ninja" as desired, e.g.: ninja bootcd

If any of these fail, it would be most helpful to have the entire output to see what went wrong.
Thank you, I used the Developer Command Prompt for VS 2019 tool to execute configure.cmd VSSolution in the ros directory and then opened the project to try to compile.
I wanted to compile with Visual Studio at first, I do n’t know if it works or not
ThFabba
Developer
Posts: 293
Joined: Sun Jul 11, 2010 11:39 am

Re: Visual Studio2019 compile reactos error

Post by ThFabba »

The solution cannot currently build a working iso. Some of the individual projects may work, but generally it's only useful for editing. To actually build, you need to use Ninja.
lialong
Posts: 4
Joined: Tue Jan 28, 2020 6:30 pm

Re: Visual Studio2019 compile reactos error

Post by lialong »

ThFabba wrote: Fri Jan 31, 2020 1:10 am The solution cannot currently build a working iso. Some of the individual projects may work, but generally it's only useful for editing. To actually build, you need to use Ninja.
Thank you, is there any example of Visual Studio compiling ntoskrnl project?
When trying to compile the ntoskrnl project, I found that Visual Studio reported a lot of the same error
LNK2001: Unresolved external symbols Many zw series functions cause compilation to fail.

My configuration environment is as follows:
CMAKE 3.16.2
Visual Studio 2019 16.4.3
wdk and sdk 10.0.18362.0
RosBE is not installed
The compilation method is as follows:
Execute configure.cmd VSS solution with Developer Command Prompt for VS 2019 successfully
MSBuild REACTOS.sln / m error
ThFabba
Developer
Posts: 293
Joined: Sun Jul 11, 2010 11:39 am

Re: Visual Studio2019 compile reactos error

Post by ThFabba »

You should use RosBE's CMake, not some other version. There are fixes in there for VSSolution in particular.

Other than that, if ntoskrnl doesn't build in the sln, there's not much to be done about it (unless of course you want to dig into the internals of CMake, which you'd be welcome to do). Ninja is the primary way to build ROS, VSSolution is just a nice extra on the side; VSSolution may become more stable and useful in the future but Ninja is likely to stay the main way because it is much faster than msbuild.
lialong
Posts: 4
Joined: Tue Jan 28, 2020 6:30 pm

Re: Visual Studio2019 compile reactos error

Post by lialong »

ThFabba wrote: Fri Jan 31, 2020 10:04 pm You should use RosBE's CMake, not some other version. There are fixes in there for VSSolution in particular.

Other than that, if ntoskrnl doesn't build in the sln, there's not much to be done about it (unless of course you want to dig into the internals of CMake, which you'd be welcome to do). Ninja is the primary way to build ROS, VSSolution is just a nice extra on the side; VSSolution may become more stable and useful in the future but Ninja is likely to stay the main way because it is much faster than msbuild.
Thank you so much ThFabba
When I try to compile the ntoskrnl module, the error message is:
1> ntoskrnl.def: error LNK2001: unresolved external symbol DbgBreakPoint
1> ntoskrnl.def: error LNK2001: unresolved external symbol DbgBreakPointWithStatus
1> ntoskrnl.def: error LNK2001: unresolved external symbol ExInterlockedAddLargeStatistic
1> ntoskrnl.def: error LNK2001: unresolved external symbol ExInterlockedFlushSList
1> ntoskrnl.def: error LNK2001: unresolved external symbol ExInterlockedPopEntrySList
1> ntoskrnl.def: error LNK2001: unresolved external symbol ExInterlockedPushEntrySList
1> ntoskrnl.def: error LNK2001: unresolved external symbol RtlRaiseException
1> ntoskrnl.def: error LNK2001: unresolved external symbol RtlRaiseStatus
1> ntoskrnl.def: error LNK2001: unresolved external symbol InterlockedPopEntrySList
1> ntoskrnl.def: error LNK2001: unresolved external symbol InterlockedPushEntrySList
1> ntoskrnl.def: error LNK2001: unresolved external symbol LdrAccessResource
1> ntoskrnl.def: error LNK2001: unresolved external symbol READ_REGISTER_BUFFER_UCHAR
1> ntoskrnl.def: error LNK2001: unresolved external symbol ZwAccessCheckAndAuditAlarm
1> ntoskrnl.def: error LNK2001: unresolved external symbol ZwAddBootEntry
1> ntoskrnl.def: error LNK2001: unresolved external symbol ZwAddDriverEntry
1> ntoskrnl.def: error LNK2001: unresolved external symbol ZwAdjustPrivilegesToken
1> ntoskrnl.def: error LNK2001: unresolved external symbol ZwAlertThread
1> ntoskrnl.def: error LNK2001: unresolved external symbol ZwAllocateVirtualMemory
1> ntoskrnl.def: error LNK2001: unresolved external symbol ZwAssignProcessToJobObject
1> ntoskrnl.def: error LNK2001: unresolved external symbol ZwCancelIoFile
1> ntoskrnl.def: error LNK2001: unresolved external symbol ZwCancelTimer
Contained under the ntoskrnl module
ctxswitch.S, fastinterlck_asm.S, ioport.S, stack.S, trap.s, usercall_asm.S, zw.S
rtl module contains
debug_asm.S, except_asm.s, interlck.S, res_asm.s, rtlmem.s,
rtlswap.S
Failure to compile in Visual Studio causes the function not to be recognized properly and results in an error.
Is there any good solution? Thank you
Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests