setting up opengl with notepad++

hi guys,
i'm trying to setup opengl using notepad++ and handling the files and directories myself rather than dealing with all the visual studio and codeblocks GUI's.

so i created a folder and named it cpp_project, and within it i created a main.cpp file.
i compiled it and everything runs as expected.

so now i wanna setup opengl, so i wrote this:
1
2
3
4
5
6
7
8
9
10
#include <iostream>
#include "GL/glew.h"
#include "GL/glfw3.h"
using namespace std;

int main()
{
	cout << "works.." << endl;
	return 0;
}


then i created a new folder in my cpp_projects folder and called it GL.
then i downloaded glfw and glew and copied the include header files in to the GL folder.
then i compiled it and everything worked.

then i wrote this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <iostream>
#include "GL/glew.h"
#include "GL/glfw3.h"
using namespace std;

int main()
{
	
	if( !glfwInit() )
	{
	cout << "failed to init glfw" << endl;
	return -1;
	}else
	{
		cout << "works" << endl;
	}
	
	return 0;
}


but as expected when i compiled it i got an error - "undefined reference to `glfwInit'"
which makes sense since i haven't put the glew or glfw source files anywhere in my project.

so i have to put the source files somewhere in my project but im just not sure where..so could someone please tell me?

ty :)
http://www.cplusplus.com/forum/general/113904/#msg622060
$ g++ foo.cpp $(pkg-config --libs glew glfw3)


If you do not have pkg-config
$ g++ foo.cpp -l{GLEW,GLU,GL,glfw}
Topic archived. No new replies allowed.