Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8900403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:05:35+00:00 2026-06-15T01:05:35+00:00

I have been going through the tutorials at http://www.sfml-dev.org/tutorials/1.6/ and I have ran into

  • 0

I have been going through the tutorials at http://www.sfml-dev.org/tutorials/1.6/ and I have ran into a problem in the using views tutorial.

Here is the section of code I am working on:

#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>

int main(){

    // Create instance of Window
    sf::Window App(sf::VideoMode(800, 600, 32), "SFML Window");

    sf::Vector2 Center(1000, 1000);
    sf::Vector2 HalfSize(400, 300);
    sf::View View1(Center, HalfSize);

    // So on...

I am using Mac OSX 10.8 and I am compiling with g++. I get the error message:

error: missing template arguments before ‘Center’

How can I correct this error?

EDIT: I somehow read the tutorial wrong. Ment to be Vector2f.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T01:05:36+00:00Added an answer on June 15, 2026 at 1:05 am

    Your problem is exactly as the error says, you’re missing a type for the Vector2 template, and judging by constructor of the View class,

    View (const sf::Vector2f &Center, const sf::Vector2f &HalfSize)
    

    You want a Vector2<float>. These types have already been typedef‘d for you in the Vector2.hpp

    // Define the most common types
    typedef Vector2<int>          Vector2i;
    typedef Vector2<unsigned int> Vector2u;
    typedef Vector2<float>        Vector2f;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been going through the tutorials of Spring 3 at http://www.vaannila.com/spring/spring-annotation-controller-1.html But i
I need to learn couchbd and have been going through tutorials on views. I
I'm going through tutorials for doctrine and have come across a problem. Does the
I'm new to databases and have been going through various tutorials, but they all
I have been working my way through the tutorials on learnpython.org and up to
I have been going through Regex tutorials for hours now and I can't seem
I'm new to python and have been going through some tutorials on log parsing
I have been going through this tutorial on auto-populating boxes using jQuery and Ajax:
I've been going through some JavaFX tutorials and I have a few questions about
I have been going through tutorials, and have been trying to understand some things,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.