title: Undefined references to GLFW / Vulkan although libraries seem to be linked
body: <p>I'm a C++ beginner with some experience in Java trying to set up a project using GLM, GLFW, and Vulkan on Windows. This is going to be my first time getting my hands dirty in a lower-level language like C++. I'm having a lot of trouble getting the compiler to link the Vulkan and GLFW libraries to my project. I'm following the tutorial <a href="https://vulkan-tutorial.com/Development_environment#page_Setting_up_Visual_Studio" rel="nofollow noreferrer">here at vulkan-tutorial.org</a> to get started. Here's the code in main.cpp:</p>
  
  <pre><code>#define GLFW_INCLUDE_VULKAN
  #include &lt;GLFW/glfw3.h&gt;
  
  #define GLM_FORCE_RADIANS
  #define GLM_FORCE_DEPTH_ZERO_TO_ONE
  #include &lt;glm/vec4.hpp&gt;
  #include &lt;glm/mat4x4.hpp&gt;
  
  #include &lt;iostream&gt;
  
  int main() {
      glfwInit();
  
      glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
      GLFWwindow* window = glfwCreateWindow(800, 600, "Vulkan window", nullptr, nullptr);
  
      uint32_t extensionCount = 0;
      vkEnumerateInstanceExtensionProperties(nullptr, &amp;extensionCount, nullptr);
  
      std::cout &lt;&lt; extensionCount &lt;&lt; " extensions supported\n";
  
      glm::mat4 matrix;
      glm::vec4 vec;
      auto test = matrix * vec;
  
      while(!glfwWindowShouldClose(window)) {
          glfwPollEvents();
      }
  
      glfwDestroyWindow(window);
  
      glfwTerminate();
  
      return 0;
  }
  </code></pre>
  
  <p>Here are the commands being used to compile it:</p>
  
  <pre><code>g++ -std=c++11 -fexceptions -g -IC:/glfw-3.2.1/include -IC:/glm-0.9.9.1/glm -IC:/VulkanSDK/1.1.82.1/Include -IC:/glfw-3.2.1/include -c "src/main.cpp"
  g++ -LC:/glfw-3.2.1/lib-mingw-w64 -LC:/VulkanSDK/1.1.82.1/Lib -o VulkanTest.exe main.o -lglfw3 -lvulkan-1
  </code></pre>
  
  <p>The first command compiles the .cpp into a .o successfully, but the second command gives me errors from the linker. Every single reference I made to a member from Vulkan or GLFW is undefined. (Path has been shortened for easier reading)</p>
  
  <pre><code>[omitted]/src/main.cpp:12: undefined reference to `glfwInit'
  [omitted]/src/main.cpp:14: undefined reference to `glfwWindowHint'
  [omitted]/src/main.cpp:15: undefined reference to `glfwCreateWindow'
  [omitted]/src/main.cpp:18: undefined reference to `vkEnumerateInstanceExtensionProperties@12'
  [omitted]/src/main.cpp:26: undefined reference to `glfwWindowShouldClose'
  [omitted]/src/main.cpp:27: undefined reference to `glfwPollEvents'
  [omitted]/src/main.cpp:30: undefined reference to `glfwDestroyWindow'
  [omitted]/src/main.cpp:32: undefined reference to `glfwTerminate'
  </code></pre>
  
  <p>It seems like the linker can't find the library files I provided with -L and -l, but if I change -lglfw3 to -llibglfw3.a or -lglwf3.dll, I get this:</p>
  
  <pre><code>[omitted]/mingw32/bin/ld.exe: cannot find -llibglfw3.a
  </code></pre>
  
  <p>or</p>
  
  <pre><code>[omitted]/mingw32/bin/ld.exe: cannot find -lglfw3.dll
  </code></pre>
  
  <p>Leading me to think that the linker DID find the libraries at first, since it didn't complain about being unable to find the library - but why can't it find sources for the references to GLFW / Vulkan functions? I have no idea what's happening. Is it finding the library files?</p>
  
  <p>I'm using GLFW 3.2.1, Vulkan SDK 1.1.82.1, MingW GCC version 6.3.0, and I'm running on Windows 10 Pro 64-bit.</p>