# How do I learn opengl or GLFW without an ide or something like cmake

**URL:** <https://discourse.glfw.org/t/how-do-i-learn-opengl-or-glfw-without-an-ide-or-something-like-cmake/1605>\
**Category:** support\
**Created:** [July 10, 2020, 7:01am UTC](https://discourse.glfw.org/t/how-do-i-learn-opengl-or-glfw-without-an-ide-or-something-like-cmake/1605 "2020-07-10T07:01:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Atomical](https://avatars.discourse-cdn.com/v4/letter/a/6bbea6/32.png) [@Atomical](https://discourse.glfw.org/u/Atomical)\
**Post date:** [July 10, 2020, 7:01am UTC](https://discourse.glfw.org/t/how-do-i-learn-opengl-or-glfw-without-an-ide-or-something-like-cmake/1605/1 "2020-07-10T07:01:20Z")

</div>

I am new to c++, I would like to get into practice of using opengl or GLFW, and also understand how to compile and link everything statically (I’m obsessed with the idea of having everything in an executable and being able to move from pc to pc) So far everywhere I look, I find tutorials based on using tools like visual studio, or cmake, (essentially tools that automate processes for you). I can see how those will be good when I understand what they’re doing for me, but as of right now, I think it’s essential I don’t skip fundamentals early on by relying on automated processes to do this for me. Is there any recommended resource as to where I can learn to compile and link libraries statically (specifically GLFW would really help) thanks.

---

<div class="post-metadata">

**Author:** ![mmozeiko](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/mmozeiko/32/29_2.png) [@mmozeiko](https://discourse.glfw.org/u/mmozeiko)\
**Post date:** [July 10, 2020, 7:35am UTC](https://discourse.glfw.org/t/how-do-i-learn-opengl-or-glfw-without-an-ide-or-something-like-cmake/1605/2 "2020-07-10T07:35:45Z")

</div>

There is really no need to use IDE or cmake with OpenGL or glfw. If you can write regular “hello world” program in C or C++ then you can write program that uses GL and glfw in same way. There is nothing special about GL and glfw from different libraries. Read up any guide how to use libraries for your compiler and you’ll be good to go.

For example, take this GLFW example code from here: [https://www.glfw.org/documentation.html](https://www.glfw.org/documentation.html)  
First make sure you have glfw downloaded (for Windows) or installed with your system packages. Then save this example to `test.c`. And then compile:

- on Linux: `gcc test.c -o test -lGL -lglfw3`
- on Windows: `cl.exe test.c -Ipath/to/glfw/include OpenGL32.lib glfw3dll.lib`

And you will get `test` or `test.exe` as output.

If you wish to compile glfw from source, then easiest way is to follow documentation on how to use cmake: [https://www.glfw.org/docs/latest/compile\_guide.html](https://www.glfw.org/docs/latest/compile_guide.html) As a result you will get static or shared library that you can keep around.

---

<div class="post-metadata">

**Author:** ![Atomical](https://avatars.discourse-cdn.com/v4/letter/a/6bbea6/32.png) [@Atomical](https://discourse.glfw.org/u/Atomical)\
**Post date:** [July 12, 2020, 8:27am UTC](https://discourse.glfw.org/t/how-do-i-learn-opengl-or-glfw-without-an-ide-or-something-like-cmake/1605/3 "2020-07-12T08:27:07Z")

</div>

Would you know of any comprehensible guides for beginners on how to use a library for such case?
