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

Author Topic: Application Builds but VS's Error List Shows Errors  (Read 1241 times)

0 Members and 1 Guest are viewing this topic.

CasualKyle

  • Newbie
  • *
  • Posts: 13
    • View Profile
    • Email
Application Builds but VS's Error List Shows Errors
« on: December 22, 2014, 02:33:58 am »
I've created a project with the minimal amount of code required to reproduce this issue on my machine. It was created with the default Microsoft Visual Studio C++ application wizard settings so it has an precompiled header file. The I've created one class:

GameManager.h
#pragma once

#include "stdafx.h"

class GameManager
{
public:
        GameManager();

private:
        sf::RenderWindow window;
};
 

GameManager.cpp
#include "stdafx.h"
#include "GameManager.h"

GameManager::GameManager() : window(sf::VideoMode(800, 600), "Testing") {}
 

I can assure you, I've got the proper SFML files downloaded and linked to my project correctly.

When I build my application the output shows that the project succeeded in building however the error list shows a total of 6 errors that all say "no instance of constructor "sf::ContextSettings::ContextSettings" matches the argument list". Visual Studio says 4 of them are from the Window.hpp SFML file and the other two are from the RenderWindow.hpp SFML file.

This baffles me because there is nothing wrong with the construction of the render window variable and I have no idea why Visual Studio would give me 6 errors but still build the application.

Anyone know what is going on and how I can get these errors fixed?

Hapax

  • Hero Member
  • *****
  • Posts: 3351
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Application Builds but VS's Error List Shows Errors
« Reply #1 on: December 22, 2014, 02:51:08 am »
I feel that I have to just point out that your code is not "complete and minimal", which could help your get a quicker response or - in some cases - a response at all.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10821
    • View Profile
    • development blog
    • Email
AW: Application Builds but VS's Error List Shows Errors
« Reply #2 on: December 22, 2014, 10:58:26 am »
Start woth an empty VS project and configure things as described in the tutorial. That way you grt rid of the stdafx.h header, which is only useful if you actually know what it's doing.

If that doesn't solve the issue, provide a minimal and complete example as well as the full error - never rephrase errors, because while you might think some of info is not important, that info might exactly be what we can use to identify the issue.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/