Bonjour,
J'ai voulu me remette à l'OpenGL mais ho surprise j'ai des erreurs de linkage
Bon j'ai eu la fameuse : error LNK2019: symbole externe non résolu __imp__glewInit référencé dans la fonction _main
Donc j'en est déduit que j'avais mal installé la lib glew. Pourtant j'ai fait comme d'habitude, éditeur de liens->glew32.lib
#include <GL/glew.h>
PS: Je code sous Visual Studio 2010, windows 7 64bit.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 #include <iostream> #include <GL/glew.h> #include <SFML/Graphics.hpp> #include <SFML/OpenGL.hpp> using namespace std; int main() { // Create the main window sf::RenderWindow window(sf::VideoMode(800, 600), "SFML OpenGL", sf::Style::Default, sf::ContextSettings(32)); window.setVerticalSyncEnabled(true); // Load a font for drawing some text sf::Font font; if (!font.loadFromFile("resources/sansation.ttf")) return EXIT_FAILURE; // Create a sprite for the background sf::Texture backgroundTexture; if (!backgroundTexture.loadFromFile("resources/background.jpg")) return EXIT_FAILURE; sf::Sprite background(backgroundTexture); //OpenGL glewInit(); return EXIT_SUCCESS; }
Partager