having problems with my linkers I think

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
43
44
45
46
47
48
49
50
51
52
53
54
55
#include<iostream>

#define GLEW_STATIC
#include "GL/glew.h"
#include "GLFW/glfw3.h"

const char* APP_TITLE = "OpenGL TESTING";
const int gWindowWidth = 800;
const int gWindowHeight = 600;


int main()
{
	if (!glfwInit)
	{
		std::cerr << "GLFW initialization failed" << std::endl;
		return -1;
	}

	glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
	glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
	glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
	glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);

	GLFWwindow* pWindow = glfwCreateWindow(gWindowWidth, gWindowHeight, APP_TITLE, NULL, NULL);

	if (pWindow == NULL)
	{
		std::cerr << "Failed to create GLFW window - Sorry My Guy" << std::endl;
		glfwTerminate();
		return -1;
	}

	glfwMakeContextCurrent(pWindow);

	glewExperimental = GL_TRUE;

	if (glewInit() != GLEW_OK)
	{
		std::cerr << "GLEW initialization failed" << std::endl;
		return -1;
	}

	//Main Loop
	while (!glfwWindowShouldClose(pWindow))
	{
		glfwPollEvents();

		glfwSwapBuffers(pWindow);
	}

	glfwTerminate();

	return 0;
}

this is the code that I have to test if my libs work for GLFW and GLEW
here is the bebugger:
1>------ Rebuild All started: Project: OpenGL_TESTING, Configuration: Debug Win32 ------
1>Main.cpp
1>e:\documents_data e\opengl\opengl_testing\src\main.cpp(14): warning C4551: function call missing argument list
1>glew32s.lib(glew.obj) : error LNK2005: _glewInit@0 already defined in glew32.lib(glew32.dll)
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>E:\Documents_DATA E\OpenGL\Debug\OpenGL_TESTING.exe : fatal error LNK1169: one or more multiply defined symbols found
1>Done building project "OpenGL_TESTING.vcxproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
Last edited on
> if (!glfwInit)
Maybe this needs to be a function call.

I got it fixed:
It' was not using a glew32s.lib.
But I appreciate the help.
Thanks
Topic archived. No new replies allowed.