Building and compiling on Ubuntu, can't find glfw3.lib

Hello everyone,

To deal with the limit on links, I’m linking a google doc here, and referencing the links contained within: https://docs.google.com/document/d/1MHeGtfWZUEZLXR3L8jvaEaCPly2ahZc3yHvQL4KhvR8/edit?usp=sharing

In my Graphics university course, we’re gonna be using OpenGL and for that purpose, I’m trying to compile GLFW from source. I’ve tried to follow the learn open gl tutorial [1] and the guide on glfw [2], but there must be something I’m missing.

I can’t find the glfw3.lib file, which is mentioned in my first link.

What I do, is:

  1. Download latest GLFW from glfw.org.

  2. Unzip

  3. Create a glfw-build folder, next to the unzipped folder. So I’m doing an “out-of-tree” build.

  4. In my terminal, I write cmake …/glfw-3.3.2 from inside the glfw-build folder.

  5. I get this output: [3]

  6. Now in the GLFW guide, it says: “You should now have all required dependencies and the project files or makefiles necessary to compile GLFW. Go ahead and compile the actual GLFW library with these files, as you would with any other project.” - I take this to mean, that I should go into the glfw-build folder and type: “make all”. Is this correct?

  7. This gives me this output: [4]

  8. Now, the glfw guide doesn’t mention any glfw3.lib file, but the LearnOpenGL guide does. They say it’s supposed to be in build/src/Debug. I’ve looked both in my build folder and the original unzipped folder, but cannot find this file. Also, I’m wondering, because normally I’d expect a Debug folder to come after, say Visual Studio, has run an application that we’ve made. But I can’t run Visual Studio as I’m on Ubuntu, but only have access to VS Code and Sublime. I know that the CMake gui can make for Sublime, but I was thinking that it should be fine with just normal unix make files as I’ve done.

I hope I’ve provided enough information for you to help me. Thanks! Sincerely tbdk.

EDIT1: I notice that in the learnopengl guide, in their CMake GUI window, that the box USE_MCVC_RUNTIME_LIBRARY_DLL is checked. Is this what creates the .lib file perhaps?

EDIT2: In [5] you can see how it looks if I use the CMake GUI. Afterwards I go to the glfw folder in terminal and write make all. I think it’s the same output as when done without the gui.

The tutorial you reference is for people using Windows and Visual Studio. Since you are using Ubuntu the steps involving compiler/link settings are not useful.

For a cross platform example try: