Ok im back with another problem...
-
Hello guys I'm trying to code in opengl so if anyone could help ill be posting info below code:
#include
#include#include
#include
#include
using namespace glm;int main(){
glewExperimental = true; if( !glfwInit() ) { fprintf( stderr, "Failed to initialize GLFW\\n" ); return -1; } glfwWindowHint(GLFW\_CONTEXT\_VERSION\_MAJOR, 3); // We want OpenGL 3.3 glfwWindowHint(GLFW\_CONTEXT\_VERSION\_MINOR, 3); glfwWindowHint(GLFW\_OPENGL\_FORWARD\_COMPAT, GL\_TRUE); // To make MacOS happy; should not be needed glfwWindowHint(GLFW\_OPENGL\_PROFILE, GLFW\_OPENGL\_CORE\_PROFILE); // We don't want the old OpenGL GLFWwindow\* window; window = glfwCreateWindow( 1024, 768, "Tutorial 01", NULL, NULL); if( window == NULL ){ fprintf( stderr, "Failed to open GLFW window. if you have an intel gpu they are not 3.3 compatible try the 2.1 version of the tutorials.\\n" ); glfwTerminate(); return -1;
}
glfwMakeContextCurrent(window); // Initialize GLEW
glewExperimental=true; // Needed in core profile
if (glewInit() != GLEW_OK) {
fprintf(stderr, "Failed to initialize GLEW\n");
return -1;
}glfwSetInputMode(window, GLFW_STICKY_KEYS, GL_TRUE);
do{
// Clear the screen. It's not mentioned before Tutorial 02, but it can cause flickering, so it's there nonetheless.
glClear( GL_COLOR_BUFFER_BIT );// Draw nothing, see you in tutorial 2 ! // Swap buffers glfwSwapBuffers(window); glfwPollEvents();
} // Check if the ESC key was pressed or the window was closed
while( glfwGetKey(window, GLFW_KEY_ESCAPE ) != GLFW_PRESS &&
glfwWindowShouldClose(window) == 0 );}
error:
1>------ Rebuild All started: Project: opengl, Configuration: Debug Win32 ------
1> lov.cpp
1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
1>C:\Users\trogd\documents\visual studio 2010\Projects\opengl\Debug\opengl.exe : fatal error LNK1120: 1 unresolved externals
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========codeproject is what keeps me going :P
-
Hello guys I'm trying to code in opengl so if anyone could help ill be posting info below code:
#include
#include#include
#include
#include
using namespace glm;int main(){
glewExperimental = true; if( !glfwInit() ) { fprintf( stderr, "Failed to initialize GLFW\\n" ); return -1; } glfwWindowHint(GLFW\_CONTEXT\_VERSION\_MAJOR, 3); // We want OpenGL 3.3 glfwWindowHint(GLFW\_CONTEXT\_VERSION\_MINOR, 3); glfwWindowHint(GLFW\_OPENGL\_FORWARD\_COMPAT, GL\_TRUE); // To make MacOS happy; should not be needed glfwWindowHint(GLFW\_OPENGL\_PROFILE, GLFW\_OPENGL\_CORE\_PROFILE); // We don't want the old OpenGL GLFWwindow\* window; window = glfwCreateWindow( 1024, 768, "Tutorial 01", NULL, NULL); if( window == NULL ){ fprintf( stderr, "Failed to open GLFW window. if you have an intel gpu they are not 3.3 compatible try the 2.1 version of the tutorials.\\n" ); glfwTerminate(); return -1;
}
glfwMakeContextCurrent(window); // Initialize GLEW
glewExperimental=true; // Needed in core profile
if (glewInit() != GLEW_OK) {
fprintf(stderr, "Failed to initialize GLEW\n");
return -1;
}glfwSetInputMode(window, GLFW_STICKY_KEYS, GL_TRUE);
do{
// Clear the screen. It's not mentioned before Tutorial 02, but it can cause flickering, so it's there nonetheless.
glClear( GL_COLOR_BUFFER_BIT );// Draw nothing, see you in tutorial 2 ! // Swap buffers glfwSwapBuffers(window); glfwPollEvents();
} // Check if the ESC key was pressed or the window was closed
while( glfwGetKey(window, GLFW_KEY_ESCAPE ) != GLFW_PRESS &&
glfwWindowShouldClose(window) == 0 );}
error:
1>------ Rebuild All started: Project: opengl, Configuration: Debug Win32 ------
1> lov.cpp
1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
1>C:\Users\trogd\documents\visual studio 2010\Projects\opengl\Debug\opengl.exe : fatal error LNK1120: 1 unresolved externals
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========codeproject is what keeps me going :P
-
Hello guys I'm trying to code in opengl so if anyone could help ill be posting info below code:
#include
#include#include
#include
#include
using namespace glm;int main(){
glewExperimental = true; if( !glfwInit() ) { fprintf( stderr, "Failed to initialize GLFW\\n" ); return -1; } glfwWindowHint(GLFW\_CONTEXT\_VERSION\_MAJOR, 3); // We want OpenGL 3.3 glfwWindowHint(GLFW\_CONTEXT\_VERSION\_MINOR, 3); glfwWindowHint(GLFW\_OPENGL\_FORWARD\_COMPAT, GL\_TRUE); // To make MacOS happy; should not be needed glfwWindowHint(GLFW\_OPENGL\_PROFILE, GLFW\_OPENGL\_CORE\_PROFILE); // We don't want the old OpenGL GLFWwindow\* window; window = glfwCreateWindow( 1024, 768, "Tutorial 01", NULL, NULL); if( window == NULL ){ fprintf( stderr, "Failed to open GLFW window. if you have an intel gpu they are not 3.3 compatible try the 2.1 version of the tutorials.\\n" ); glfwTerminate(); return -1;
}
glfwMakeContextCurrent(window); // Initialize GLEW
glewExperimental=true; // Needed in core profile
if (glewInit() != GLEW_OK) {
fprintf(stderr, "Failed to initialize GLEW\n");
return -1;
}glfwSetInputMode(window, GLFW_STICKY_KEYS, GL_TRUE);
do{
// Clear the screen. It's not mentioned before Tutorial 02, but it can cause flickering, so it's there nonetheless.
glClear( GL_COLOR_BUFFER_BIT );// Draw nothing, see you in tutorial 2 ! // Swap buffers glfwSwapBuffers(window); glfwPollEvents();
} // Check if the ESC key was pressed or the window was closed
while( glfwGetKey(window, GLFW_KEY_ESCAPE ) != GLFW_PRESS &&
glfwWindowShouldClose(window) == 0 );}
error:
1>------ Rebuild All started: Project: opengl, Configuration: Debug Win32 ------
1> lov.cpp
1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
1>C:\Users\trogd\documents\visual studio 2010\Projects\opengl\Debug\opengl.exe : fatal error LNK1120: 1 unresolved externals
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========codeproject is what keeps me going :P
You have setup a Console project to what is a Win GUI code or vice vesa. When you first setup the project you had two choices windows console or windows GUI you selected the wrong one, whatever the case. Not sure why you are staying on VS2010 rather than updating as it's free but on VS2017 You can change it after you make the project via Project -> Properties -> Configuration Properties -> Linker -> System It will be something similar on VS2010 and what you are after is subsystem and it will be either Windows (/SUBSYSTEM:WINDOWS) OR Console (/SUBSYSTEM:CONSOLE) Whichever one it is on currently it's wrong for the project, select the other.
In vino veritas