Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: VS 2022 isn't creating .exe file in empty project with Windows Desktop Wizard  (Read 1272 times)

0 Members and 1 Guest are viewing this topic.

oritsemisan

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
I have searched through the internet yet I can't find a solution to my VS 2022 "no .exe file found" error. I am a newbie in SFML and I followed every step on how to install SFML on VS code from the SFML website.

When I start a new console Project, I made sure it was an empty Project (check that check box). Add a .cpp file manually. Link all files to the Project and run the small code snippet from the example.

I also followed all the steps in adding the include and lib files to the projects properties yet when I compile, the folders for release and debug are created inside the Projects folder, yet I get a warning that the compiler can't find the Projects exe-file. This warning Starts with "There were build errors. Would you like to continue and run the last successful build?" which I always click yes then it gives the error.

The error is something like this - Unable to start Program:  '"c:\users\name\documents\Projects\ConsoleApplication1\Debug\ConsoleApplication1.exe"' The system cannot find the file specified . . .

Has anyone any ideas?

Here is my code though
#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
    sf::CircleShape shape(100.f);
    shape.setFillColor(sf::Color::Green);

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

        window.clear();
        window.draw(shape);
        window.display();
    }

    return 0;
}
 
« Last Edit: August 26, 2022, 02:37:20 am by oritsemisan »

kojack

  • Sr. Member
  • ****
  • Posts: 343
  • C++/C# game dev teacher.
    • View Profile
When it says "There were build errors. Would you like to continue and run the last successful build?" the best option is almost always to choose no.
That message is saying something went wrong and nothing was built. So if you haven't had a successful build in the past, there's no leftover previous exe file to run instead.

What are the errors it is listing when compiling? (In the Error List or Output tabs, usually at the bottom)

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Said differently, if you have build errors, you need to fix them first. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

oritsemisan

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Here  are the errors as requested

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
You're trying to link 32-bits library files while having 64-bits selected as architecture for building your application.
Make sure they match.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything