Jul 18, 2013 at 10:55pm UTC
and how do i create the main.cpp because when i create a class it has a .h
Jul 18, 2013 at 10:59pm UTC
file->new file, choose c++ source file.
Jul 18, 2013 at 11:04pm UTC
i have included all of the files in the linker settings but i get an error in the #include <GL/glew.h>
Jul 18, 2013 at 11:10pm UTC
You should have a folder called, C:/usr/include/GL, and in it, you should have files called glew.h, glxew.h, and wglew.h.
In project->build options->search directories->compiler, you should have added c:/usr/include
Last edited on Jul 18, 2013 at 11:11pm UTC
Jul 19, 2013 at 12:59am UTC
i have an error with
sf::ContexSettings(24, 8, 4, 4, 0));
'ContexSettings' is not a member of 'sf'|
||=== Build finished: 1 errors, 0 warnings (0 minutes, 0 seconds) ===|
Last edited on Jul 19, 2013 at 1:18am UTC
Jul 19, 2013 at 1:40am UTC
It should be sf::ContextSettings
Last edited on Jul 19, 2013 at 1:41am UTC
Jul 19, 2013 at 1:45am UTC
so many errors!
ld.exe||cannot find -lglew32s|
ld.exe||cannot find -lsfm-graphics|
ld.exe||cannot find -lsfml-window|
ld.exe||cannot find -lsfml-system|
urgggggg
Last edited on Jul 19, 2013 at 2:26am UTC
Jul 19, 2013 at 2:51am UTC
I personally use code::blocks with the mingw that comes with it
Jul 19, 2013 at 3:20am UTC
yeah i just wish setting up opengl would be easier for codeblocks
Jul 19, 2013 at 3:27am UTC
Where ever you put those files that the linker cannot find, add that directory to project->build options->search directories->linker.
Last edited on Jul 19, 2013 at 3:29am UTC
Jul 19, 2013 at 3:54am UTC
I use Qt Creator for all my projects under Linux and when I use Windows.
Jul 19, 2013 at 4:20am UTC
still getting issues i can't find the library and i have done what you said
is there a video tutorial? or some type of documentation?
Last edited on Jul 19, 2013 at 4:21am UTC
Jul 19, 2013 at 4:26am UTC
is setting up openGL for codeblocks any harder than sfml?
Jul 19, 2013 at 4:46am UTC
well im trying to do 3d graphics in codeblocks
but im trying to set it up
Last edited on Jul 19, 2013 at 4:47am UTC
Jul 19, 2013 at 5:27am UTC
Can you post the directory that glew32s.lib is in, and the path you specified in linker search directories. For example, I have glew32s.lib in c:\usr\lib, and I have c:\usr\lib added to the linker search directory.
Last edited on Jul 19, 2013 at 5:41am UTC
Jul 19, 2013 at 12:57pm UTC
i fixed the libary issues but i got an error stating
The procedure entry point _gxx_personlity_v0 could not be located in the dynamic link libary libstdc++-6.dll
this is my code
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 34 35 36 37 38 39 40 41 42
#include <windows.h>
#define GLEW_STATIC
#include <GL/glew.h>
#include <SFML/OpenGL.hpp>
#include <SFML/Window.hpp>
//#include various standard libraries
//some constants
int WIDTH = 1280;
int HEIGHT = 720;
int main()
{
sf::Window window(sf::VideoMode(WIDTH, HEIGHT),
"SFML OpenGL" ,
sf::Style::Default,
sf::ContextSettings(24, 8, 4, 4, 0));
//last two parameters of cont. set. are openGL major and minor versions,
//in this case, OpenGL 4.0
glewExperimental = true ;
if (glewInit() != GLEW_OK)
return -1;
bool quit = false ;
while (! quit) {
sf::Event event;
while (window.pollEvent(event)) {
if (event.type == sf::Event::Closed)
quit = true ;
}
//use sfml keyboard and mouse input stuff
//use sfml clock stuff for timer
//game.update(/*..*/);
//game.render(/*..*/);
window.display();
}
return 0;
}
Last edited on Jul 19, 2013 at 1:09pm UTC
Jul 19, 2013 at 5:46pm UTC
Maybe you are compiling with a different version of GCC than the SFML version you downloaded?
In the first link, in the red box, it tells you how to figure out which version of GCC you're using. Go into C:/MinGW/bin and find a file called either libgcc_s_sjlj-1.dll, or libgcc_s_dw2-1.dll, which will indicate whether you have the SJLJ or DW2 version of GCC. Then go back and download the correct version of SFML and get rid of the wrong version.
http://www.sfml-dev.org/tutorials/2.0/start-cb.php
http://www.sfml-dev.org/download/sfml/2.0/
Last edited on Jul 19, 2013 at 5:53pm UTC