How to compile apps in visual studio to run inside ros?

Here you can discuss ReactOS related topics.

Moderator: Moderator Team

Post Reply
Elentirith
Posts: 1
Joined: Sat Oct 09, 2021 3:02 am

How to compile apps in visual studio to run inside ros?

Post by Elentirith »

I admit I don't really understand the different c runtimes (ucrt, etc) that msvc has, but I thought if if I at least compiled hello world in VS2019 it would run inside ros but that is not the case. Do I need to modify the compiler settings, run a vc redistributable, or something else? I also tried changing the Platform Toolset option under Project -> Properties but it only allows you to select "Visual Studio 2019 (v142)". I would include an image of the error but I don't see that option anywhere in this forum. The error is "The application has failed to start because MSVCP140d.dll was not. Re-installing the application may fix this problem.". Any help would be appreciated!
User avatar
binarymaster
Posts: 481
Joined: Sun Nov 16, 2014 7:05 pm
Location: Russia, Moscow
Contact:

Re: How to compile apps in visual studio to run inside ros?

Post by binarymaster »

Elentirith wrote: Thu Jul 21, 2022 12:00 am How to compile apps in visual studio to run inside ros?
Read this guide on our wiki: https://reactos.org/wiki/Developing_Rea ... ual_Studio

If you follow every step described there, you should have no problem building apps.
User avatar
dizt3mp3r
Posts: 1874
Joined: Mon Jun 14, 2010 5:54 pm

Re: How to compile apps in visual studio to run inside ros?

Post by dizt3mp3r »

I run Visual Studio 6.0 to create apps for ReactOS and they generally work out of the box as long as the components/dependencies of the program (APIs) &c are also present. Using VS 6.0 is a Server 2003/XP era compatible app and so it should be no surprise that it creates programs fairly easily for ReactOS.

If you are merely testing, then I suggest trying earlier versions of VS whose binaries might just work out-of-the-box. Finding out what the runtime components are and then manually moving them over to ReactOS is likely to be required.
Skillset: VMS,DOS,Windows Sysadmin from 1985, fault-tolerance, VaxCluster, Alpha,Sparc. DCL,QB,VBDOS- VB6,.NET, PHP,NODE.JS, Graphic Design, Project Manager, CMS, Quad Electronics. classic cars & m'bikes. Artist in water & oils. Historian.
Greenhorn
Posts: 3
Joined: Thu Nov 04, 2021 1:49 am

Re: How to compile apps in visual studio to run inside ros?

Post by Greenhorn »

> The error is "The application has failed to start because MSVCP140d.dll was not [found]. Re-installing the application may fix this problem."

This error means that you've linked dynamically to the crt and therefore you must provide MSVCP140d.dll with your application. It has nothing to do with ReactOS.

To solve this issue you should link statically to the crt.
https://docs.microsoft.com/en-us/cpp/bu ... w=msvc-170
Set the switch /MT for Release and /MTd for Debug configuration in the compiler settings.
learn_more
Developer
Posts: 246
Joined: Fri Dec 19, 2014 10:00 pm

Re: How to compile apps in visual studio to run inside ros?

Post by learn_more »

Greenhorn wrote: Mon Aug 01, 2022 12:14 am > The error is "The application has failed to start because MSVCP140d.dll was not [found]. Re-installing the application may fix this problem."

This error means that you've linked dynamically to the crt and therefore you must provide MSVCP140d.dll with your application. It has nothing to do with ReactOS.

To solve this issue you should link statically to the crt.
https://docs.microsoft.com/en-us/cpp/bu ... w=msvc-170
Set the switch /MT for Release and /MTd for Debug configuration in the compiler settings.
and additionally, you are running a debug build, which is not something you should distribute
MadWolf
Posts: 688
Joined: Sat Dec 31, 2005 4:19 am
Contact:

Re: How to compile apps in visual studio to run inside ros?

Post by MadWolf »

hi
MSVCP140d.dll is part of the visual c++ redistributable 2015
I recommend you use an older version of Visual Studio that can run on windows XP or Install the Windows XP platform toolset
https://docs.microsoft.com/en-us/cpp/bu ... w=msvc-160
learn_more
Developer
Posts: 246
Joined: Fri Dec 19, 2014 10:00 pm

Re: How to compile apps in visual studio to run inside ros?

Post by learn_more »

MadWolf wrote: Thu Aug 04, 2022 4:43 am hi
MSVCP140d.dll is part of the visual c++ redistributable 2015
I recommend you use an older version of Visual Studio that can run on windows XP or Install the Windows XP platform toolset
https://docs.microsoft.com/en-us/cpp/bu ... w=msvc-160
no it is not,
the 'd' in the filename means it is a debug version of the dll, which means it is not available in the redist.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest