shared pointers, error C2783 what should I do? what argument is the right one?

  • CeciPeque
    Likes 0

    Problem Description

    #pragma once
    #include <memory>
    #include <string>
    #include <SFML/Graphics.hpp>
    #include "StateMachine.h"
    #include "AssetManager.h"
    #include "InputManager.h"

    namespace Peque
    {
        struct GameData
        {
            StateMachine machine;
            sf::RenderWindow window;
            AssetManager assets;
            InputManager input;
        };

        typedef std::shared_ptr<GameData> GameDataRef;

        class Game
        {
        public:
            Game(int width, int height, std::string title);

        private:
            const float dt = 1.0f / 60.0f;
            sf::Clock _clock;
            GameDataRef _data = std::make_shared<GameData>(); //ERROR IN HERE.

            void Run();
        };
    }

  • Sonar Systems admin
    Likes 0

    On what line are you having this problem?

  • CeciPeque
    Likes 0

    in the almost last one, I commented  //ERROR IN HERE so somebody could see.

  • CeciPeque
    Likes 0

     GameDataRef _data = std::make_shared<GameData>(); is in this line but I don’t understand what the problem is, it says this: error C2783: 'std::shared_ptr<_Ty> std::make_shared(_Types &&...)' : could not deduce template argument for '_Ty'.

  • CeciPeque
    Likes 0

    is from the Tic-Tac-Toc Sonar course, is anybody going to respond or not? 

  • Sonar Systems admin
    Likes 0

    Have you tried the code from GitHub?

  • CeciPeque
    Likes 0

    now I did and it gives me errors, it’s the same as mine, I have the default compiler of visual studio but is version 2013, but I don’t want to unistall everything. :( I can’t finish the course with this compiler.

  • CeciPeque
    Likes 0

    can you tell me which compiler do I have to use for the Sonar Tic-Tac-Toe course?

  • CeciPeque
    Likes 0

    I have spent three days asking and nobody seems to know which templante argument is the right one. 

    I´d be glad if you could give me an answer so I can stop wasting my time. are you actually a programer? shouldn’t you know the answer?


  • Sonar Systems admin
    Likes 0

    I used Visual Studio 2015, try that version.

  • CeciPeque
    Likes 0

    ok I’ll try that one 

  • Sonar Systems admin
    Likes 0

    Let us know how it goes.

  • CeciPeque
    Likes 0

    now I have another issue with 2015 version, is not exactly an error, is justa a pop up that says somenthing about an interruption but the program runs, so is not an error, when I press interrup the pop up is gone and the program keeps runing.

  • CeciPeque
    Likes 0

    hey where can I find the resources?, in GitHub I only find the code.

Login to reply