admin管理员组文章数量:1122832
I'm working on a very simple Vulkan application. Up until now, I've been linking with the GLFW DLL that I installed via my OS's package manager (and I haven’t had any issues with that). After downloading and compiling the GLFW source code to link statically, my program still compiles and runs just fine, but no window appears during runtime.
I've tried calling glfwMakeContextCurrent()
and glfwShowWindow()
, but neither resolved the issue.
A very simple test program that I wrote:
#define GLFW_INCLUDE_VULKAN
#include <GLFW/glfw3.h>
int main(void)
{
if(glfwInit() != GLFW_TRUE)
{
return 1;
}
GLFWwindow *window = glfwCreateWindow(800, 600, "Test Window", NULL, NULL);
if(window == NULL)
{
return 1;
}
while(!glfwWindowShouldClose(window))
{
glfwPollEvents();
}
glfwDestroyWindow(window);
glfwTerminate();
}
Compiling and running with the following command displays the window just fine
gcc main.c -o main -lglfw -lvulkan
While compiling and running like this does not
gcc main.c -o main -I./glfw/include -L./glfw/build/src -lglfw3 -lvulkan -lm
I’m wondering if anyone has any insight into what the problem may be. Thanks!
I'm working on a very simple Vulkan application. Up until now, I've been linking with the GLFW DLL that I installed via my OS's package manager (and I haven’t had any issues with that). After downloading and compiling the GLFW source code to link statically, my program still compiles and runs just fine, but no window appears during runtime.
I've tried calling glfwMakeContextCurrent()
and glfwShowWindow()
, but neither resolved the issue.
A very simple test program that I wrote:
#define GLFW_INCLUDE_VULKAN
#include <GLFW/glfw3.h>
int main(void)
{
if(glfwInit() != GLFW_TRUE)
{
return 1;
}
GLFWwindow *window = glfwCreateWindow(800, 600, "Test Window", NULL, NULL);
if(window == NULL)
{
return 1;
}
while(!glfwWindowShouldClose(window))
{
glfwPollEvents();
}
glfwDestroyWindow(window);
glfwTerminate();
}
Compiling and running with the following command displays the window just fine
gcc main.c -o main -lglfw -lvulkan
While compiling and running like this does not
gcc main.c -o main -I./glfw/include -L./glfw/build/src -lglfw3 -lvulkan -lm
I’m wondering if anyone has any insight into what the problem may be. Thanks!
Share Improve this question asked yesterday KafviqKafviq 311 silver badge2 bronze badges New contributor Kafviq is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.1 Answer
Reset to default 0Rolling back to the previous release of GLFW (3.3.10) resolved the issue :)
本文标签: cIssues displaying GLFW window when linking with static libraryStack Overflow
版权声明:本文标题:c - Issues displaying GLFW window when linking with static library - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736283893a1927119.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论