Trying to create my first window, running into some errors, take a look at my code?

// GLEW
#define GLEW_STATIC
#include <GL/glew.h>
// GLFW
#include <GLFW/glfw3.h>
int main()
{
glfwInit();
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_RESIZABLE, GL_FALSE);

return 0;

}
GLFWwindow* window = glfwCreateWindow(800, 600, “LearnOpenGL”, nullptr, nullptr);
if (window == nullptr)
{
std::cout << “Failed to create GLFW window” << std::endl;
glfwTerminate();
return -1;
}
glfwMakeContextCurrent(window);

glewExperimental = GL_TRUE;
if (glewInit() != GLEW_OK)
{
std::cout << “Failed to initialize GLEW” << std::endl;
return -1;
}
glViewport(0, 0, 800, 600);
while (!glfwWindowShouldClose(window))
{
glfwPollEvents();
glfwSwapBuffers(window);
}
glfwTerminate();
return 0;

The errors I’m getting:
Severity Code Description Project File Line
Error (active) expected a declaration win32console c:\Users\Admin\OpenGL\TheBrookyBox\win32console\win32console\config.cpp 18
Error C2059 syntax error: ‘if’ win32console c:\users\admin\opengl hebrookybox\win32console\win32console\config.cpp 18
Error C2143 syntax error: missing ‘;’ before ‘{’ win32console c:\users\admin\opengl hebrookybox\win32console\win32console\config.cpp 19
Error C2447 ‘{’: missing function header (old-style formal list?) win32console c:\users\admin\opengl hebrookybox\win32console\win32console\config.cpp 19
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int win32console c:\users\admin\opengl hebrookybox\win32console\win32console\config.cpp 24
Error C2365 ‘glfwMakeContextCurrent’: redefinition; previous definition was ‘function’ win32console c:\users\admin\opengl hebrookybox\win32console\win32console\config.cpp 24
Error C2440 ‘initializing’: cannot convert from ‘GLFWwindow *’ to ‘int’ win32console c:\users\admin\opengl hebrookybox\win32console\win32console\config.cpp 24
Error (active) this declaration has no storage class or type specifier win32console c:\Users\Admin\OpenGL\TheBrookyBox\win32console\win32console\config.cpp 26
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int win32console c:\users\admin\opengl hebrookybox\win32console\win32console\config.cpp 26
Error C2371 ‘glewExperimental’: redefinition; different basic types win32console c:\users\admin\opengl hebrookybox\win32console\win32console\config.cpp 26
Error (active) expected a declaration win32console c:\Users\Admin\OpenGL\TheBrookyBox\win32console\win32console\config.cpp 27
Error C2059 syntax error: ‘if’ win32console c:\users\admin\opengl hebrookybox\win32console\win32console\config.cpp 27
Error C2143 syntax error: missing ‘;’ before ‘{’ win32console c:\users\admin\opengl hebrookybox\win32console\win32console\config.cpp 28
Error C2447 ‘{’: missing function header (old-style formal list?) win32console c:\users\admin\opengl hebrookybox\win32console\win32console\config.cpp 28
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int win32console c:\users\admin\opengl hebrookybox\win32console\win32console\config.cpp 32
Error C2365 ‘glViewport’: redefinition; previous definition was ‘function’ win32console c:\users\admin\opengl hebrookybox\win32console\win32console\config.cpp 32
Error C2440 ‘initializing’: cannot convert from ‘initializer list’ to ‘int’ win32console c:\users\admin\opengl hebrookybox\win32console\win32console\config.cpp 32
Error (active) expected a declaration win32console c:\Users\Admin\OpenGL\TheBrookyBox\win32console\win32console\config.cpp 33
Error C2059 syntax error: ‘while’ win32console c:\users\admin\opengl hebrookybox\win32console\win32console\config.cpp 33
Error C2143 syntax error: missing ‘;’ before ‘{’ win32console c:\users\admin\opengl hebrookybox\win32console\win32console\config.cpp 34
Error C2447 ‘{’: missing function header (old-style formal list?) win32console c:\users\admin\opengl hebrookybox\win32console\win32console\config.cpp 34
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int win32console c:\users\admin\opengl hebrookybox\win32console\win32console\config.cpp 38
Error C2556 ‘int glfwTerminate(void)’: overloaded function differs only by return type from ‘void glfwTerminate(void)’ win32console c:\users\admin\opengl hebrookybox\win32console\win32console\config.cpp 38
Error C2371 ‘glfwTerminate’: redefinition; different basic types win32console c:\users\admin\opengl hebrookybox\win32console\win32console\config.cpp 38
Error (active) expected a declaration win32console c:\Users\Admin\OpenGL\TheBrookyBox\win32console\win32console\config.cpp 39
Error C2059 syntax error: ‘return’ win32console c:\users\admin\opengl hebrookybox\win32console\win32console\config.cpp 39

[ol]
[li]Please use the [CODE][/CODE] tag. It does make code (and its errors) easier to read; see below.[/li][li]Pay attention to the two lines that go after [/li]```
glfwWindowHint(GLFW_RESIZABLE, GL_FALSE);


Namely: 

return 0;
}


This means you are ending your [b]main()[/b] function, so everything that goes below is out of its context.
Unlike many other programming languages, C/C++ disallows code to be placed outside a function, which seems to be the cause of your errors.
Remove these two lines, and put a closing curly brace at the very end of your code, and it might work.
[/ol]

[QUOTE=hidefromkgb;1279213][ol]
[li]Please use the [CODE][/CODE] tag. It does make code (and its errors) easier to read; see below.
[/li][li]Pay attention to the two lines that go after [/li]```
glfwWindowHint(GLFW_RESIZABLE, GL_FALSE);


Namely: 

return 0;
}


This means you are ending your [b]main()[/b] function, so everything that goes below is out of its context.
Unlike many other programming languages, C/C++ disallows code to be placed outside a function, which seems to be the cause of your errors.
Remove these two lines, and put a closing curly brace at the very end of your code, and it might work.
[/ol][/QUOTE]


// GLEW
#define GLEW_STATIC
#include &lt;GL/glew.h&gt;
// GLFW
#include &lt;GLFW/glfw3.h&gt;
int main()
{
	glfwInit();
	glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
	glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
	glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
	glfwWindowHint(GLFW_RESIZABLE, GL_FALSE);

	
GLFWwindow* window = glfwCreateWindow(800, 600, "LearnOpenGL", nullptr, nullptr);
if (window == nullptr)
{
	std::cout &lt;&lt; "Failed to create GLFW window" &lt;&lt; std::endl;
	glfwTerminate();
	return -1;
}
glfwMakeContextCurrent(window);

glewExperimental = GL_TRUE;
if (glewInit() != GLEW_OK)
{
	std::cout &lt;&lt; "Failed to initialize GLEW" &lt;&lt; std::endl;
	return -1;
}
glViewport(0, 0, 800, 600);
while (!glfwWindowShouldClose(window))

	glfwPollEvents();
	glfwSwapBuffers(window);
}
Edited the code


Now I'm getting these errors:
Severity	Code	Description	Project	File	Line
Error	C2039	'cout': is not a member of 'std'	win32console	c:\users\admin\opengl	hebrookybox\win32console\win32console\config.cpp	19
Error	C2065	'cout': undeclared identifier	win32console	c:\users\admin\opengl	hebrookybox\win32console\win32console\config.cpp	19
Error	C2039	'endl': is not a member of 'std'	win32console	c:\users\admin\opengl	hebrookybox\win32console\win32console\config.cpp	19
Error	C2065	'endl': undeclared identifier	win32console	c:\users\admin\opengl	hebrookybox\win32console\win32console\config.cpp	19
Error (active)		namespace "std" has no member "cout"	win32console	c:\Users\Admin\OpenGL\TheBrookyBox\win32console\win32console\config.cpp	19
Error (active)		namespace "std" has no member "endl"	win32console	c:\Users\Admin\OpenGL\TheBrookyBox\win32console\win32console\config.cpp	19
Error	C2039	'cout': is not a member of 'std'	win32console	c:\users\admin\opengl	hebrookybox\win32console\win32console\config.cpp	28
Error	C2065	'cout': undeclared identifier	win32console	c:\users\admin\opengl	hebrookybox\win32console\win32console\config.cpp	28
Error	C2039	'endl': is not a member of 'std'	win32console	c:\users\admin\opengl	hebrookybox\win32console\win32console\config.cpp	28
Error	C2065	'endl': undeclared identifier	win32console	c:\users\admin\opengl	hebrookybox\win32console\win32console\config.cpp	28
Error (active)		namespace "std" has no member "cout"	win32console	c:\Users\Admin\OpenGL\TheBrookyBox\win32console\win32console\config.cpp	28
Error (active)		namespace "std" has no member "endl"	win32console	c:\Users\Admin\OpenGL\TheBrookyBox\win32console\win32console\config.cpp	28

You need to add

#include <iostream>