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

Author Topic: Visual Studio Community 2015 main.cpp missing from SFML_template  (Read 5072 times)

0 Members and 1 Guest are viewing this topic.

AlanGrid

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
I created an SFML template and encountered the issue to open main.cpp from the Source Files folder, I got the error message - "The document cannot be opened. It has been renamed, deleted or moved." The next attempt to build the other one gave me the same result. And even after upgrade  Version 14.25420.01 Update3 I wasn't capable create my own template, just because of this weird issue, which didn't allow me to open main.cpp.  I tried to delete .suo file, but it was useless because all my settings ('include' & 'lib') was wiped out.

So till now  I didn't get perfect SFML template without manual work.



I didn't find any useful and similar cases with web search, so, I hope someone will share the idea how to solve it


I'll be very grateful for any suggestion.
« Last Edit: October 10, 2016, 08:30:55 pm by AlanGrid »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11033
    • View Profile
    • development blog
    • Email
AW: Visual Studio Community 2015 Source File missing from SFML_template
« Reply #1 on: October 10, 2016, 07:18:24 pm »
What template are you talking about? We don't provide an official template.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

jamesL

  • Full Member
  • ***
  • Posts: 124
    • View Profile
Re: Visual Studio Community 2015 Source File missing from SFML_template
« Reply #2 on: October 10, 2016, 08:17:50 pm »
he says she's trying to create his own, but its failing

he's asking for help creating a template

I don't use VS so I can't help

AlanGrid

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: Visual Studio Community 2015 main.cpp missing from SFML_template
« Reply #3 on: October 10, 2016, 08:43:22 pm »

Yes. correct, all SFML templates I created in VS 2015 had the same issue, it didn't let me open the main.cpp file.

So I'm looking for the solution to this problem. If someone encountered the similar issues creating his own SFML template in VS 2015, please share the solution how to fix that.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Visual Studio Community 2015 main.cpp missing from SFML_template
« Reply #4 on: October 10, 2016, 09:05:34 pm »
So this is a Visual Studio issue and has nothing to do with SFML, right? The SFML forum is not the right place to ask such questions.
Laurent Gomila - SFML developer

AlanGrid

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: Visual Studio Community 2015 main.cpp missing from SFML_template
« Reply #5 on: October 11, 2016, 01:18:55 am »
I do not agree!

Probably someone encountered the similar issues creating his own SFML template in VS 2015. So this stage will become right please at once if the solution will be found.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Visual Studio Community 2015 main.cpp missing from SFML_template
« Reply #6 on: October 11, 2016, 06:19:38 am »
Quote
I do not agree!

Probably someone encountered the similar issues creating his own SFML template in VS 2015
Probably someone encountered the same problem with his XYZ template and it still has nothing to do with SFML ;)
« Last Edit: October 12, 2016, 03:30:01 pm by Laurent »
Laurent Gomila - SFML developer

Jonny

  • Full Member
  • ***
  • Posts: 114
    • View Profile
    • Email
Re: Visual Studio Community 2015 main.cpp missing from SFML_template
« Reply #7 on: October 12, 2016, 02:23:58 pm »
Just for the record, I've created VS SFML templates for 2013 and 2015 without (major) problems, so I'm confident it isn't an SFML problem. The templates are on the VS extension gallery so you can try them out if you want (Go to create new project -> online and search for "SFML" and you should find it). As Laurent said they aren't official, and I've only added them in case they are of use to anyone else.

My best guess for your problem would be that you aren't including the source files correctly when you create the template, but there are better places to find help with that than here. Hope you solve your problem.
« Last Edit: October 12, 2016, 02:25:36 pm by Jonny »

AlanGrid

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: Visual Studio Community 2015 main.cpp missing from SFML_template
« Reply #8 on: October 13, 2016, 08:04:42 pm »
Greate, Jonny!

Could you share how exactly include source file (main.cpp) correctly using ExporteTemplate, because I didn't find any option of it in Export Template Wizard?

This is my steps:

First of all, I created the solution SFMLTest:

1) File/New/Project/Visual C++/Win32ConsoleAplication/SFMLTest

Next:

2) SFMLTest/Add/NewItem/C++File(.cpp)/main.cpp

Next:
3)SFMLTest/Properties/Configuration Properties/C/C++/General/AdditionalIncludedeDerictories/$(SolutionDir)/SFML/include

Next:

4)SFMLTest/Properties/Configuration Properties/Linker/General/AdditionalLibraryDerictories/$(SolutionDir)/SFML/lib

Next:
5)SFMLTest/Properties/Configuration Properties/Linker/Input/AdditionalDependencies/

sfml-main-d.lib
sfml-graphics-d.lib
sfml-window-d.lib
sfml-system-d.lib
sfml-audio-d.lib
sfml-network-d.lib

Next:
6)The simple code in the main.cpp:

#include "SFML/Graphics.hpp"
#include <iostream>
using namespace std;

int main() {

sf::RenderWindow window(sf::VideoMode(800, 600), "SFML Game!");

sf::CircleShape circle(50);
circle.setFillColor(sf::Color::Yellow);




while (window.isOpen()) {
sf::Event event;
while (window.pollEvent(event)) {
switch (event.type) {
case sf::Event::Closed:
window.close();
break;
}
}

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

The final step to create a template:

7)File/ExportTemplate/ProjectTemplate/Template name/Finish


That's all my steps to create a template from my SFMLproject file.

After that, I wasn't able to open main.cpp file from SourceFiles folder, my guess for this problem is that Template Exporter  not include the source file correctly when  created the template.

Could you point to my misstep I'll really appreciate your help?
« Last Edit: October 13, 2016, 08:17:22 pm by AlanGrid »

ToyAuthor

  • Newbie
  • *
  • Posts: 21
    • View Profile
    • Email
Re: Visual Studio Community 2015 main.cpp missing from SFML_template
« Reply #9 on: October 14, 2016, 04:12:48 am »
Hello AlanGrid
I recommand you using SFML with CMake + Visual Studio 2015.
Project template doesn't bring any benefit for cross-platform.

Visual Studio 2017 may be add more tricks and remove old one.
It's wasting your time.

Jonny

  • Full Member
  • ***
  • Posts: 114
    • View Profile
    • Email
Re: Visual Studio Community 2015 main.cpp missing from SFML_template
« Reply #10 on: October 27, 2016, 08:24:39 am »
Unhelpful post

You didn't really address anything to do with this topic. Also I find templates very useful, and time saving rather than time wasting.

AlanGrid: I just followed the steps here: https://msdn.microsoft.com/en-us/library/xkh1wxd8.aspx and it was all quite straightforward. Very hard to say why yours isn't working, but you might have better luck on other more relevant forums, as it seems to be more related to Visual Studio and not a problem with SFML.

Also for future reference use
[code=cpp]
tags when posting code please, makes it much more readable :)