No sure how to set up Opengl

I am learning c++ and i would like to try to make a 2d game and I heard that for c++ opengl is the best option .I have Visual Studio 2013 and i am not sure how to set up opengl with it . There aren't many tutorials online and i am just not sure which opengl files i need and how to link them . Thank you
I personally prefer to use SFML as the window manager and have it set up the OpenGL context for me. Aside from doing that, it also offers input, window events, and audio functionality which OpenGL does not provide on its own.

http://www.sfml-dev.org/


The arcsynthesis tutorial shows how to set up without SFML, although I think it uses FreeGLUT in its place:

http://www.arcsynthesis.org/gltut/

Note: The arc synthesis tutorial is worth reading regardless -- it is hands down the best OpenGL tutorial I've ever seen. Don't trust any site that has you using glBegin/glEnd.
Thank you I will try this could you point out which part of the tutorial tells you how to link the sumo,libraries to visual studio ?
I have followed the instructions on the website on how to link everything and tried to run some SFML code to see if it works . In the debugger i got these errors:
Error 17 error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup c:\Users\Family\documents\visual studio 2013\Projects\Win32Project2\Win32Project2\MSVCRTD.lib(crtexew.obj) Win32Project2
Error 6 error LNK2019: unresolved external symbol "public: void __thiscall sf::Window::display(void)" (?display@Window@sf@@QAEXXZ) referenced in function _main c:\Users\Family\documents\visual studio 2013\Projects\Win32Project2\Win32Project2\Source.obj Win32Project2
Error 3 error LNK2019: unresolved external symbol "public: void __thiscall sf::Window::close(void)" (?close@Window@sf@@QAEXXZ) referenced in function _main c:\Users\Family\documents\visual studio 2013\Projects\Win32Project2\Win32Project2\Source.obj Win32Project2
Error 13 error LNK2019: unresolved external symbol "public: void __thiscall sf::Shape::setFillColor(class sf::Color const &)" (?setFillColor@Shape@sf@@QAEXABVColor@2@@Z) referenced in function _main c:\Users\Family\documents\visual studio 2013\Projects\Win32Project2\Win32Project2\Source.obj Win32Project2
Error 9 error LNK2019: unresolved external symbol "public: void __thiscall sf::RenderTarget::draw(class sf::Drawable const &,class sf::RenderStates const &)" (?draw@RenderTarget@sf@@QAEXABVDrawable@2@ABVRenderStates@2@@Z) referenced in function _main c:\Users\Family\documents\visual studio 2013\Projects\Win32Project2\Win32Project2\Source.obj Win32Project2
Error 8 error LNK2019: unresolved external symbol "public: void __thiscall sf::RenderTarget::clear(class sf::Color const &)" (?clear@RenderTarget@sf@@QAEXABVColor@2@@Z) referenced in function _main c:\Users\Family\documents\visual studio 2013\Projects\Win32Project2\Win32Project2\Source.obj Win32Project2
Error 12 error LNK2019: unresolved external symbol "public: virtual __thiscall sf::Shape::~Shape(void)" (??1Shape@sf@@UAE@XZ) referenced in function "public: virtual __thiscall sf::CircleShape::~CircleShape(void)" (??1CircleShape@sf@@UAE@XZ) c:\Users\Family\documents\visual studio 2013\Projects\Win32Project2\Win32Project2\Source.obj Win32Project2
Error 11 error LNK2019: unresolved external symbol "public: virtual __thiscall sf::RenderWindow::~RenderWindow(void)" (??1RenderWindow@sf@@UAE@XZ) referenced in function _main c:\Users\Family\documents\visual studio 2013\Projects\Win32Project2\Win32Project2\Source.obj Win32Project2
Error 5 error LNK2019: unresolved external symbol "public: bool __thiscall sf::Window::pollEvent(class sf::Event &)" (?pollEvent@Window@sf@@QAE_NAAVEvent@2@@Z) referenced in function _main c:\Users\Family\documents\visual studio 2013\Projects\Win32Project2\Win32Project2\Source.obj Win32Project2
Error 4 error LNK2019: unresolved external symbol "public: bool __thiscall sf::Window::isOpen(void)const " (?isOpen@Window@sf@@QBE_NXZ) referenced in function _main c:\Users\Family\documents\visual studio 2013\Projects\Win32Project2\Win32Project2\Source.obj Win32Project2
Error 2 error LNK2019: unresolved external symbol "public: __thiscall sf::VideoMode::VideoMode(unsigned int,unsigned int,unsigned int)" (??0VideoMode@sf@@QAE@III@Z) referenced in function _main c:\Users\Family\documents\visual studio 2013\Projects\Win32Project2\Win32Project2\Source.obj Win32Project2
Error 1 error LNK2019: unresolved external symbol "public: __thiscall sf::String::String(char const *,class std::locale const &)" (??0String@sf@@QAE@PBDABVlocale@std@@@Z) referenced in function _main c:\Users\Family\documents\visual studio 2013\Projects\Win32Project2\Win32Project2\Source.obj Win32Project2
Error 10 error LNK2019: unresolved external symbol "public: __thiscall sf::RenderWindow::RenderWindow(class sf::VideoMode,class sf::String const &,unsigned int,struct sf::ContextSettings const &)" (??0RenderWindow@sf@@QAE@VVideoMode@1@ABVString@1@IABUContextSettings@1@@Z) referenced in function _main c:\Users\Family\documents\visual studio 2013\Projects\Win32Project2\Win32Project2\Source.obj Win32Project2
Error 7 error LNK2019: unresolved external symbol "public: __thiscall sf::Color::Color(unsigned char,unsigned char,unsigned char,unsigned char)" (??0Color@sf@@QAE@EEEE@Z) referenced in function _main c:\Users\Family\documents\visual studio 2013\Projects\Win32Project2\Win32Project2\Source.obj Win32Project2
Error 14 error LNK2019: unresolved external symbol "public: __thiscall sf::CircleShape::CircleShape(float,unsigned int)" (??0CircleShape@sf@@QAE@MI@Z) referenced in function _main c:\Users\Family\documents\visual studio 2013\Projects\Win32Project2\Win32Project2\Source.obj Win32Project2
Error 16 error LNK2001: unresolved external symbol "public: static class sf::RenderStates const sf::RenderStates::Default" (?Default@RenderStates@sf@@2V12@B) c:\Users\Family\documents\visual studio 2013\Projects\Win32Project2\Win32Project2\Source.obj Win32Project2
Error 15 error LNK2001: unresolved external symbol "public: static class sf::Color const sf::Color::Green" (?Green@Color@sf@@2V12@B) c:\Users\Family\documents\visual studio 2013\Projects\Win32Project2\Win32Project2\Source.obj Win32Project2
Error 18 error LNK1120: 17 unresolved externals c:\users\family\documents\visual studio 2013\Projects\Win32Project2\Debug\Win32Project2.exe Win32Project2


What did I do wrong ?
You're not linking to the sfml libs.

For visual studio I just make a common "sfml.h" header file that pragma links all these libs so I don't have to deal with it:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

#pragma once
#ifndef SFMLFULL_INCLUDED
#define SFMLFULL_INCLUDED

#define SFML_STATIC
#define GL_GLEXT_PROTOTYPES

#include <SFML/Audio.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/OpenGL.hpp>
#include <SFML/Network.hpp>
#include <SFML/System.hpp>
#include <SFML/Window.hpp>

#if defined(_DEBUG) || defined(DEBUG)
    #pragma comment(lib,"sfml-graphics-s-d.lib")
    #pragma comment(lib,"sfml-audio-s-d.lib")
    #pragma comment(lib,"sfml-network-s-d.lib")
    #pragma comment(lib,"sfml-window-s-d.lib")
    #pragma comment(lib,"sfml-system-s-d.lib")
    #pragma comment(lib,"sfml-main-d.lib")
#else
    #pragma comment(lib,"sfml-graphics-s.lib")
    #pragma comment(lib,"sfml-audio-s.lib")
    #pragma comment(lib,"sfml-network-s.lib")
    #pragma comment(lib,"sfml-window-s.lib")
    #pragma comment(lib,"sfml-system-s.lib")
    #pragma comment(lib,"sfml-main.lib")
#endif


#endif // SFMLFULL_INCLUDED 


#include this header instead of the usual sfml headers and those problems should go away.
Topic archived. No new replies allowed.