0

After installing Visual Studio 2022, Dev C++ won't run my C++ code (any code) but it worked before installing Dev C++.

"Failed to execute Error 193: %1 is not a valid Win32 application."

I know Dev is obsolete which is why I'm transitioning to (maybe) VC but I need Dev to still work for now. How to I reverse this? Did Installation of VS change something in the registry?

If this has something to do with there being spaces in the file path, it's not the reason because Dev it wasn't bothered by it before. VS broke it somehow.

Some Student
  • 134
  • 6
  • Update: The executable runs. It's Dev that refuses to run it even though Dev created that exe. – Some Student Feb 02 '23 at 17:10
  • 2
    `%1` looks like a parameter for what should be the name of your compiled binary. If I had to guess it looks like something in your environment path got clobbered. – NathanOliver Feb 02 '23 at 17:10
  • Who closed this question? The link does not answer the question! – Some Student Feb 02 '23 at 17:18
  • @SomeStudent if your project path does not contain any spaces, add that to the question body with a reference to the linked question and we can reopen this – Cubic Feb 02 '23 at 17:21
  • 1
    Visual Studio Community should have nothing to do with Dev C++ at all. I don't think you had Dev C++ configured to use the msvc compiler from Visual Studio. Most likely you used MinGW in Dev C++ which Visual Studio should not have changed. – drescherjm Feb 02 '23 at 17:21
  • The problem started after installing VS. Dev can work with paths with spaces in them. Please read the question. – Some Student Feb 02 '23 at 17:23
  • 1
    The duplicate's not that useful, but the question was on the verge of being closed anyway because it lacks too many details to provide a conclusive answer. – user4581301 Feb 02 '23 at 17:23
  • @Cubic My project paths does contain spaces and I want to keep them. Spaces are allowed in Dev because I have always had them. – Some Student Feb 02 '23 at 17:25
  • I agree with @user4581301. The duplicate is not great but this question probably can't be answered anyways without the person asking spending a lot of time to investigate and get logs ... – drescherjm Feb 02 '23 at 17:25
  • 1
    Is there any kind of log or information that could be added that has more information about the problem? The error message alone is not easy to help with. What I mean is unless you are also a Dev C++ user who has run into this exact same error and figured out how to solve you can't help because there is not enough information to debug the issue. – drescherjm Feb 02 '23 at 17:54
  • 1
    @SomeStudent I know you said it used to work fine with spaces, but if you do remove them does it start to work again or do you get the same issue? – NathanOliver Feb 02 '23 at 17:55
  • @drescherjm This is a good answer! These things aren't obvious to me because I'm not an expert. Anyway, I copy-pasted my code into VS and it actually ran without errors or warnings which makes Dev obsolete as fas as I'm concerned. – Some Student Feb 02 '23 at 17:58
  • 1
    It'd help if we knew your version of Dev C++. I've found [some evidence](https://i.stack.imgur.com/eQfdj.jpg) that Dev C++ 5.11 still had the issue with starting programs with space in the path. – Ted Lyngmo Feb 02 '23 at 18:04
  • If you still like Dev-C++, [here's an update from a few years ago](https://github.com/Embarcadero/Dev-Cpp/releases). My recommendation is to download and install one without the GCC9.2 compiler, [install an up-to-date compiler from MSYS](https://stackoverflow.com/a/30071634/4581301), and point Dev-C++ at the newer GCC version. – user4581301 Feb 02 '23 at 19:26

0 Answers0