# How to prevent GLFW from trying to link vulkan functions?

**URL:** <https://discourse.glfw.org/t/how-to-prevent-glfw-from-trying-to-link-vulkan-functions/839>\
**Category:** support\
**Created:** [January 21, 2017, 7:32am UTC](https://discourse.glfw.org/t/how-to-prevent-glfw-from-trying-to-link-vulkan-functions/839 "2017-01-21T07:32:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zzzhhh](https://avatars.discourse-cdn.com/v4/letter/z/65b543/32.png) [@zzzhhh](https://discourse.glfw.org/u/zzzhhh)\
**Post date:** [January 21, 2017, 7:32am UTC](https://discourse.glfw.org/t/how-to-prevent-glfw-from-trying-to-link-vulkan-functions/839/1 "2017-01-21T07:32:18Z")

</div>

Hi, I encountered the following errors when I tried to compile an OpenGL program using GLFW:

```
g++ -o dist/Debug/GNU-Linux/opengl1 build/Debug/GNU-Linux/01-triangles.o -L/home/me/glfw-3.2.1/bin/lib -lglfw3 -pthread -lGLU -lGL -lrt -lXrandr -lXxf86vm -lXi -lXinerama -lX11
/usr/bin/ld: /home/me/glfw-3.2.1/bin/lib/libglfw3.a(vulkan.c.o): undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line

```

It seems that `dlclose` is a vulkan function which GLFW tries to link but vulkan is not installed on the Linux system I am using. So how to prevent GLFW from trying to link any vulkan function, or have GLFW library not include any vulkan entries when I build it from GLFW source, or is there any other way that can make me successfully compile the program on linux? Thank a lot.

---

<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:** [January 21, 2017, 8:34am UTC](https://discourse.glfw.org/t/how-to-prevent-glfw-from-trying-to-link-vulkan-functions/839/2 "2017-01-21T08:34:29Z")

</div>

`dlclose` is not a Vulkan function. It is dynamic linker library function. You need to link to `dl` library. Try adding `-ldl` to linker arguments.

---

<div class="post-metadata">

**Author:** ![zzzhhh](https://avatars.discourse-cdn.com/v4/letter/z/65b543/32.png) [@zzzhhh](https://discourse.glfw.org/u/zzzhhh)\
**Post date:** [January 21, 2017, 5:29pm UTC](https://discourse.glfw.org/t/how-to-prevent-glfw-from-trying-to-link-vulkan-functions/839/3 "2017-01-21T17:29:09Z")

</div>

Thank you for the reply. I had thought the problem is related to vulkan so I asked in particular in this separate thread, but after I added -ldl, the linker errors returns to its origin. Could you please take a look at the problem in thread “[How to link GLFW?](http://discourse.glfw.org/t/how-to-link-glfw/838)” Thanks a lot.
