[QUOTE=sim642;37099734]Right click on your project on the left column -> Build options... -> Click on project name in left column -> Linker settings tab -> Click Add -> Select glew32s.lib -> Done![/QUOTE]
Ok; I did that. Now the errors are:
[cpp]Linking console executable: bin\Debug\OpenGL_Project1.exe
..\..\glew-1.8.0\lib\glew32s.lib(./static/release/glew.obj):(.text[_glewInit@0]+0x0): multiple definition of `glewInit@0'
..\..\glew-1.8.0\lib\glew32.lib(glew32.dll):(.text+0x0): first defined here
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
..\..\glew-1.8.0\lib\glew32s.lib(./static/release/glew.obj):(.text[__glewInit_GL_VERSION_1_2]+0x4): undefined reference to `_imp__wglGetProcAddress@4'
..\..\glew-1.8.0\lib\glew32s.lib(./static/release/glew.obj):(.text[__glewInit_GL_VERSION_1_3]+0x4): undefined reference to `_imp__wglGetProcAddress@4'
..\..\glew-1.8.0\lib\glew32s.lib(./static/release/glew.obj):(.text[__glewInit_GL_VERSION_1_4]+0x4): undefined reference to `_imp__wglGetProcAddress@4'
..\..\glew-1.8.0\lib\glew32s.lib(./static/release/glew.obj):(.text[__glewInit_GL_VERSION_1_5]+0x4): undefined reference to `_imp__wglGetProcAddress@4'
..\..\glew-1.8.0\lib\glew32s.lib(./static/release/glew.obj):(.text[__glewInit_GL_VERSION_2_0]+0x4): undefined reference to `_imp__wglGetProcAddress@4'
..\..\glew-1.8.0\lib\glew32s.lib(./static/release/glew.obj):(.text[__glewInit_GL_VERSION_2_1]+0x4): more undefined references to `_imp__wglGetProcAddress@4' follow
..\..\glew-1.8.0\lib\glew32s.lib(./static/release/glew.obj):(.text[_glewGetExtension@4]+0xa): undefined reference to `_imp__glGetString@4'
..\..\glew-1.8.0\lib\glew32s.lib(./static/release/glew.obj):(.text[_glewContextInit@0]+0x4): undefined reference to `_imp__glGetString@4'
..\..\glew-1.8.0\lib\glew32s.lib(./static/release/glew.obj):(.text[__glewInit_WGL_3DL_stereo_control]+0x7): undefined reference to `_imp__wglGetProcAddress@4'
..\..\glew-1.8.0\lib\glew32s.lib(./static/release/glew.obj):(.text[__glewInit_WGL_AMD_gpu_association]+0x4): undefined reference to `_imp__wglGetProcAddress@4'
..\..\glew-1.8.0\lib\glew32s.lib(./static/release/glew.obj):(.text[__glewInit_WGL_ARB_buffer_region]+0x4): undefined reference to `_imp__wglGetProcAddress@4'
..\..\glew-1.8.0\lib\glew32s.lib(./static/release/glew.obj):(.text[__glewInit_WGL_ARB_create_context]+0x7): undefined reference to `_imp__wglGetProcAddress@4'
..\..\glew-1.8.0\lib\glew32s.lib(./static/release/glew.obj):(.text[__glewInit_WGL_ARB_extensions_string]+0x7): undefined reference to `_imp__wglGetProcAddress@4'
..\..\glew-1.8.0\lib\glew32s.lib(./static/release/glew.obj):(.text[__glewInit_WGL_ARB_make_current_read]+0x4): more undefined references to `_imp__wglGetProcAddress@4' follow
..\..\glew-1.8.0\lib\glew32s.lib(./static/release/glew.obj):(.text[_wglewGetExtension@4]+0x21): undefined reference to `_imp__wglGetCurrentDC@0'
..\..\glew-1.8.0\lib\glew32s.lib(./static/release/glew.obj):(.text[_wglewContextInit@0]+0x4): undefined reference to `_imp__wglGetProcAddress@4'
..\..\glew-1.8.0\lib\glew32s.lib(./static/release/glew.obj):(.text[_wglewContextInit@0]+0x3e): undefined reference to `_imp__wglGetCurrentDC@0'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 1 seconds)
16 errors, 1 warnings
[/cpp]
My code is in one of my posts above; it hasn't changed.
[QUOTE=Meatpuppet;37107228]Ok; I did that. Now the errors are:
[cpp]Linking console executable: bin\Debug\OpenGL_Project1.exe
..\..\glew-1.8.0\lib\glew32s.lib(./static/release/glew.obj):(.text[_glewInit@0]+0x0): multiple definition of `glewInit@0'
..\..\glew-1.8.0\lib\glew32.lib(glew32.dll):(.text+0x0): first defined here
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
..\..\glew-1.8.0\lib\glew32s.lib(./static/release/glew.obj):(.text[__glewInit_GL_VERSION_1_2]+0x4): undefined reference to `_imp__wglGetProcAddress@4'
..\..\glew-1.8.0\lib\glew32s.lib(./static/release/glew.obj):(.text[__glewInit_GL_VERSION_1_3]+0x4): undefined reference to `_imp__wglGetProcAddress@4'
..\..\glew-1.8.0\lib\glew32s.lib(./static/release/glew.obj):(.text[__glewInit_GL_VERSION_1_4]+0x4): undefined reference to `_imp__wglGetProcAddress@4'
..\..\glew-1.8.0\lib\glew32s.lib(./static/release/glew.obj):(.text[__glewInit_GL_VERSION_1_5]+0x4): undefined reference to `_imp__wglGetProcAddress@4'
..\..\glew-1.8.0\lib\glew32s.lib(./static/release/glew.obj):(.text[__glewInit_GL_VERSION_2_0]+0x4): undefined reference to `_imp__wglGetProcAddress@4'
..\..\glew-1.8.0\lib\glew32s.lib(./static/release/glew.obj):(.text[__glewInit_GL_VERSION_2_1]+0x4): more undefined references to `_imp__wglGetProcAddress@4' follow
..\..\glew-1.8.0\lib\glew32s.lib(./static/release/glew.obj):(.text[_glewGetExtension@4]+0xa): undefined reference to `_imp__glGetString@4'
..\..\glew-1.8.0\lib\glew32s.lib(./static/release/glew.obj):(.text[_glewContextInit@0]+0x4): undefined reference to `_imp__glGetString@4'
..\..\glew-1.8.0\lib\glew32s.lib(./static/release/glew.obj):(.text[__glewInit_WGL_3DL_stereo_control]+0x7): undefined reference to `_imp__wglGetProcAddress@4'
..\..\glew-1.8.0\lib\glew32s.lib(./static/release/glew.obj):(.text[__glewInit_WGL_AMD_gpu_association]+0x4): undefined reference to `_imp__wglGetProcAddress@4'
..\..\glew-1.8.0\lib\glew32s.lib(./static/release/glew.obj):(.text[__glewInit_WGL_ARB_buffer_region]+0x4): undefined reference to `_imp__wglGetProcAddress@4'
..\..\glew-1.8.0\lib\glew32s.lib(./static/release/glew.obj):(.text[__glewInit_WGL_ARB_create_context]+0x7): undefined reference to `_imp__wglGetProcAddress@4'
..\..\glew-1.8.0\lib\glew32s.lib(./static/release/glew.obj):(.text[__glewInit_WGL_ARB_extensions_string]+0x7): undefined reference to `_imp__wglGetProcAddress@4'
..\..\glew-1.8.0\lib\glew32s.lib(./static/release/glew.obj):(.text[__glewInit_WGL_ARB_make_current_read]+0x4): more undefined references to `_imp__wglGetProcAddress@4' follow
..\..\glew-1.8.0\lib\glew32s.lib(./static/release/glew.obj):(.text[_wglewGetExtension@4]+0x21): undefined reference to `_imp__wglGetCurrentDC@0'
..\..\glew-1.8.0\lib\glew32s.lib(./static/release/glew.obj):(.text[_wglewContextInit@0]+0x4): undefined reference to `_imp__wglGetProcAddress@4'
..\..\glew-1.8.0\lib\glew32s.lib(./static/release/glew.obj):(.text[_wglewContextInit@0]+0x3e): undefined reference to `_imp__wglGetCurrentDC@0'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 1 seconds)
16 errors, 1 warnings
[/cpp]
My code is in one of my posts above; it hasn't changed.[/QUOTE]
Link with OpenGL32.lib as well.
Guys, still don't work! My gcc says that SDL/SDL.h does not exist. Same error that I posted the pic.
[QUOTE=mlbfan560;37107681]Link with OpenGL32.lib as well.[/QUOTE]
Where can I find that?
[QUOTE=Meatpuppet;37108468]Where can I find that?[/QUOTE]
On Google....: [url]http://www.opengl.org/discussion_boards/showthread.php/176620-Need-help-missing-opengl32-lib-glu32-lib[/url]
[QUOTE=Topgamer7;37108715]On Google....: [url]http://www.opengl.org/discussion_boards/showthread.php/176620-Need-help-missing-opengl32-lib-glu32-lib[/url][/QUOTE]
...I don't have the file
[QUOTE=Meatpuppet;37109074]...I don't have the file[/QUOTE]
It comes with Windows. Just add it to the linker input.
Is there a way to silently kill threads in .NET?
Thread.Abort always displays the "<Program> has stopped working" message if I run the program without debugger.
[editline]Fixed.[/editline]
Never mind, I made it emit a small conditional after each expression so the thread dies by itself if it's killed now.
Someone know some links that teach C programming with struct return?
And yeah...I need help with SDL, because gcc still don't recognize the header file.
[QUOTE=mlbfan560;37109264]It comes with Windows. Just add it to the linker input.[/QUOTE]
[cpp]cannot find -lOpenGL32.lib[/cpp]
[QUOTE=Tamschi;37110147]Is there a way to silently kill threads in .NET?
Thread.Abort always displays the "<Program> has stopped working" message if I run the program without debugger.[/QUOTE]
[url=http://www.interact-sw.co.uk/iangblog/2004/11/12/cancellation]Don't abort threads[/url]. Set a flag that tells the thread to terminate itself, then [url=http://msdn.microsoft.com/en-us/library/system.threading.thread.join]join[/url] it to wait for it to end gracefully. If the thread might be blocked on a long-running operation like I/O, [url=http://msdn.microsoft.com/en-us/library/system.threading.thread.interrupt]interrupt[/url] it (and handle interruptions gracefully in the thread) to ensure that it notices the terminate flag in a timely manner.
[QUOTE=Meatpuppet;37113036][cpp]cannot find -lOpenGL32.lib[/cpp][/QUOTE]
If you're using MinGW use -lopengl32.
What are you guys' recomendation for books for someone looking to get into game development through C# or C++? I am not a complete beginner- I've done a significant amount of work with C and Arduino programming autonomous robots so understand the bare basics like code structure, loops, and functions.
That being said, I don't really know enough to just jump right in off tutorials online. So any recommendations are appreciated.
Thanks!
So I have a fire rate for weapons on client and server, I have a problem where client is able to fire but on the server the time for the fire isn't ready yet, resulting in the server not firing the weapon but the client shows it does.
To solve this I queue up the weapon fire requests on the server and process them every tick, if it's not ready to fire yet, it checks again next tick. I think this is a really stupid and messy thing to do but I'm not sure of any other way to deal with it.
(I can also see this being a problem when the weapon switches while there's still fire requests on the server)
I think the whole problem is caused by the time it takes for the server to respond to a fire message but I'm not sure.
Looks like that's the case. If I log each primary attack request on the server, I get something like this:
[code]
time since last primary attack request is 0.612476
time since last primary attack request is 0.633513
time since last primary attack request is 0.589096
time since last primary attack request is 0.612063
[/code]
The fire rate for this weapon is 0.6 so if I was to check if the weapon can fire on that third request, it would come back false.
[QUOTE=mlbfan560;37116071]If you're using MinGW use -lopengl32.[/QUOTE]
[cpp]||=== OpenGL_Project1, Debug ===|
..\..\glew-1.8.0\lib\glew32.lib(glew32.dll)|| first defined here|
ld.exe||cannot find -llopenGL32.lib|
||=== Build finished: 2 errors, 0 warnings ===|
[/cpp]
[QUOTE=Meatpuppet;37119325][cpp]||=== OpenGL_Project1, Debug ===|
..\..\glew-1.8.0\lib\glew32.lib(glew32.dll)|| first defined here|
ld.exe||cannot find -llopenGL32.lib|
||=== Build finished: 2 errors, 0 warnings ===|
[/cpp][/QUOTE]
-lopengl32
not -llopengl32
[QUOTE=Richy19;37119365]-lopengl32
not -llopengl32[/QUOTE]
[t]http://img215.imageshack.us/img215/5600/78925882.png[/t]
i don't know how to crop an image in paint.net but i just want you to see that all i put was lopengl
If you put in in that box it should just be opengl32.lib
Still not working.
Code::Blocks (or was it the linker?) automatically cuts out the .lib so try removing that part.
-snip- i did it i want to thank all of you and god
[editline]7th August 2012[/editline]
On this page [url]http://open.gl/drawing[/url] I'm getting lost at the part about compiling shaders. How do I compile one?
[editline]7th August 2012[/editline]
I'm really lost. Do I put all of that code in my program? If so, where?
[editline]7th August 2012[/editline]
And how do I make code in c++ after #version 150?
[editline]7th August 2012[/editline]
Where do I put all of this code? You just put it in blocks and I have no idea where it goes. This really doesn't make sense.
[QUOTE=Meatpuppet;37120535]-snip- i did it i want to thank all of you and god
[editline]7th August 2012[/editline]
On this page [url]http://open.gl/drawing[/url] I'm getting lost at the part about compiling shaders. How do I compile one?
[editline]7th August 2012[/editline]
I'm really lost. Do I put all of that code in my program? If so, where?
[editline]7th August 2012[/editline]
And how do I make code in c++ after #version 150?
[editline]7th August 2012[/editline]
Where do I put all of this code? You just put it in blocks and I have no idea where it goes. This really doesn't make sense.[/QUOTE]
Shaders are written in a specific shader-language, GLSL in this case. GLSL is essentially C with a few simplifications and tweaks. It's compiled when you run your program by your C++ code.
I know that.
[editline]7th August 2012[/editline]
But where do I put it?
[editline]7th August 2012[/editline]
story of my life
[QUOTE=Meatpuppet;37120983]I know that.
[editline]7th August 2012[/editline]
But where do I put it?
[editline]7th August 2012[/editline]
story of my life[/QUOTE]
I would suggest putting it in a file, reading in the entire file into a string and then pass that in where he passes in &vertexSource.
[QUOTE=ArgvCompany;37121123]I would suggest putting it in a file, reading in the entire file into a string and then pass that in where he passes in &vertexSource.[/QUOTE]
I have no idea how to do that. Are you sure? The tutorial doesn't say anything about that
[QUOTE=Meatpuppet;37121316]I have no idea how to do that. Are you sure? The tutorial doesn't say anything about that[/QUOTE]
[QUOTE=open.gl]Compiling shaders is easy once you have loaded the source code (either from file or as a hardcoded string).[/QUOTE]
[QUOTE=Wyzard;37113044][url=http://www.interact-sw.co.uk/iangblog/2004/11/12/cancellation]Don't abort threads[/url]. Set a flag that tells the thread to terminate itself, then [url=http://msdn.microsoft.com/en-us/library/system.threading.thread.join]join[/url] it to wait for it to end gracefully. If the thread might be blocked on a long-running operation like I/O, [url=http://msdn.microsoft.com/en-us/library/system.threading.thread.interrupt]interrupt[/url] it (and handle interruptions gracefully in the thread) to ensure that it notices the terminate flag in a timely manner.[/QUOTE]
I know this, but I'm writing a compiler for a language where flow control is implemented by killing something and looping until it's (un)dead. There's no real shared state, so unrolling the stack with a silent exception from somewhere in managed code would be completely safe.
(Unless the framework doesn't clean up properly.)
[QUOTE=MakeR;37121341][/QUOTE]
So that's what that means?
[editline]7th August 2012[/editline]
[QUOTE=MakeR;37121341]Compiling shaders is easy once you have loaded the source code (either from file or as a hardcoded string).[/QUOTE]
[editline]7th August 2012[/editline]
Guess I can't learn this then. Oh well, would be great if the tut showed me exactly what to do.
[QUOTE=laylay;37118541]So I have a fire rate for weapons on client and server, I have a problem where client is able to fire but on the server the time for the fire isn't ready yet, resulting in the server not firing the weapon but the client shows it does.
To solve this I queue up the weapon fire requests on the server and process them every tick, if it's not ready to fire yet, it checks again next tick. I think this is a really stupid and messy thing to do but I'm not sure of any other way to deal with it.
(I can also see this being a problem when the weapon switches while there's still fire requests on the server)
I think the whole problem is caused by the time it takes for the server to respond to a fire message but I'm not sure.
Looks like that's the case. If I log each primary attack request on the server, I get something like this:
[code]
time since last primary attack request is 0.612476
time since last primary attack request is 0.633513
time since last primary attack request is 0.589096
time since last primary attack request is 0.612063
[/code]
The fire rate for this weapon is 0.6 so if I was to check if the weapon can fire on that third request, it would come back false.[/QUOTE]
Are you time-stamping your packets so you know exactly when they were sent? I had similar trouble with my networking when the client and server's times were off; time stamping packets allowed me to move the server backwards in time to the exact request of the client's actions. This caused much better synchronization and made the game more predictable.
Other than blaming networking problems I don't know what to say, sorry.
[QUOTE=Meatpuppet;37121376]So that's what that means?
[editline]7th August 2012[/editline]
[editline]7th August 2012[/editline]
Guess I can't learn this then. Oh well, would be great if the tut showed me exactly what to do.[/QUOTE]
This is taken straight from one of the open.gl exercises.
[cpp]const char* fragmentSource =
"#version 150\n"
"in float Color;"
"out vec4 outColor;"
"void main() {"
" outColor = vec4( Color, Color, Color, 1.0 );"
"}";
GLuint fragmentShader = glCreateShader( GL_FRAGMENT_SHADER );
glShaderSource( fragmentShader, 1, &fragmentSource, NULL );
glCompileShader( fragmentShader );[/cpp]
The shader source is hardcoded as a const char *. Alternatively you can load the shader source into a string from a file.
Sorry, you need to Log In to post a reply to this thread.