glfw

GLFW - Failed To Open A Window

时间秒杀一切 提交于 2019-11-30 11:14:53
As my hunt for a cross-platform framework/library went in progress, GLFW was mentioned many times. So, I decided to try it out. Now, it seems as though I can't even init a window. :-/ #include #include #include int main(int argc, char *argv[]) { int running = GL_TRUE; srand(time(NULL)); if (!glfwInit()) exit(EXIT_FAILURE); if (!glfwOpenWindow(300, 300, 0, 0, 0, 0, 0, 0, GLFW_WINDOW)) { glfwTerminate(); exit(EXIT_FAILURE); } while (running) { glClear(GL_COLOR_BUFFER_BIT); glClearColor(rand() % 255 + 1, rand() % 255 + 1, rand() % 255 + 1, 0); glfwSwapBuffers(); running = !glfwGetKey(GLFW_KEY_ESC

Compiling with GLFW3, linker errors 'undefined reference'

醉酒当歌 提交于 2019-11-30 10:07:10
Having a minimal example using GLFW3 : #include <GLFW/glfw3.h> int main(int argc, const char * argv[]) { glfwInit(); } ...results in a ton of linker errors: (small excerpt) Undefined symbols for architecture x86_64: "_CFArrayAppendValue", referenced from: _addJoystickElement in libglfw3.a(cocoa_joystick.m.o) "_CFArrayApplyFunction", referenced from: __glfwInitJoysticks in libglfw3.a(cocoa_joystick.m.o) _addJoystickElement in libglfw3.a(cocoa_joystick.m.o) "_CFArrayCreateMutable", referenced from: __glfwInitJoysticks in libglfw3.a(cocoa_joystick.m.o) ... "_objc_msgSend_fixup", referenced from:

glfw3 error: DSO Missing from command line

邮差的信 提交于 2019-11-30 09:22:25
I recently had to reinstall Linux Mint on my PC. I reinstalled all my libraries, such as GLFW and came across an error I have never seen before. Unfortunately my google-fu skills do not seem up to par for this error as I've not been able to find any fixes that work for me. Sidenote: these programs compiled fine on my old installation, and they also compile perfectly fine on my laptop that also runs Linux Mint 17.2. This is the compile statement I using to compile: g++ -std=c++11 main.cpp -o out -lGL -lGLU -lglfw3 -lX11 -lXxf86vm -lXrandr -lpthread -lXi This is what the terminal spits out at me

Why is my OpenGL version always 2.1 on Mac OS X?

左心房为你撑大大i 提交于 2019-11-30 07:09:34
问题 I'm using GLFW 3.0 on Mac OS X 10.8, graphic card is Intel HD Graphics 5000 And my OpenGL API version is 2.1, aquired by glfwGetWindowAttrib(window, GLFW_CONTEXT_VERSION_MAJOR); glfwGetWindowAttrib(window, GLFW_CONTEXT_VERSION_MINOR); Compiling options: g++ ... -framework OpenGL -framework Cocoa -framework IOKit ... Headers: #include <GLFW/glfw3.h> #include <GL/glu.h> The version is always 2.1, unlike the reported 3.2. My OS has been upgraded to 10.9, and OpenGL version is still 2.1. It still

Proper way to link a static library using GCC

ⅰ亾dé卋堺 提交于 2019-11-30 00:10:54
Why is it that some static libraries (lib*.a) can be linked in the same way that shared libraries (lib*.so) are linked (ld -l switch), but some can not? I had always been taught that all libraries, static or not, can be linked with -l..., however I've run into one library so far (GLFW), which does nothing but spew "undefined reference" link errors if I attempt to link it this way. According to the response on this question , the "proper" way to link static libraries is to include them directly, along with my own object files, rather than using -l. And, in the case of the GLFW library, this

Compiling with GLFW3, linker errors 'undefined reference'

妖精的绣舞 提交于 2019-11-29 15:18:23
问题 Having a minimal example using GLFW3 : #include <GLFW/glfw3.h> int main(int argc, const char * argv[]) { glfwInit(); } ...results in a ton of linker errors: (small excerpt) Undefined symbols for architecture x86_64: "_CFArrayAppendValue", referenced from: _addJoystickElement in libglfw3.a(cocoa_joystick.m.o) "_CFArrayApplyFunction", referenced from: __glfwInitJoysticks in libglfw3.a(cocoa_joystick.m.o) _addJoystickElement in libglfw3.a(cocoa_joystick.m.o) "_CFArrayCreateMutable", referenced

glfw3 error: DSO Missing from command line

流过昼夜 提交于 2019-11-29 13:27:23
问题 I recently had to reinstall Linux Mint on my PC. I reinstalled all my libraries, such as GLFW and came across an error I have never seen before. Unfortunately my google-fu skills do not seem up to par for this error as I've not been able to find any fixes that work for me. Sidenote: these programs compiled fine on my old installation, and they also compile perfectly fine on my laptop that also runs Linux Mint 17.2. This is the compile statement I using to compile: g++ -std=c++11 main.cpp -o

Undefined reference errors when linking GLFW on MinGW

假装没事ソ 提交于 2019-11-29 11:18:09
I am trying to develop an openGL application with GLEW and GLFW on Windows using minGW. In the current directory, project/ , I have the directories src/ , bin/ , and glfw-3.0.4.bin.WIN64/ . I have the files test.cpp , glew.h , glew.c , and wglew.h in the src/ directory. The directory ./glfw-3.0.4.bin.WIN64/include/ contains the GLFW/glfw3.h header file. The directory ./glfw-3.0.4.bin.WIN64/lib-mingw/ contains glfw3.dll , glfw3dll.a , and libglfw3.a . My main file, test.cpp contains, #include "glew.h" #include "GLFW/glfw3.h" #include <stdio.h> int main(int argc, char** argv) { printf("Hello,

OpenGL笔记(1)配置环境

こ雲淡風輕ζ 提交于 2019-11-29 08:23:20
准备事项 编译器 :装有c++组件包的visual studio 2019 GLFW :在 GLFW下载地址 中下载32位的Windows预编译二进制文件 GLEW :在 GLEW下载地址 中直接点击下载glew文件即可 做完上述步骤后,我们会得到两个压缩包,把压缩包的文件放在同一个文件夹中,进行下一步。 项目配置 打开vs2019,创建一个c++空项目,命名为OpenGL_Template,创建一个main.cpp文件,以后的项目可以以此项目为模板,就不用重新配置环境。 include文件配置 打开项目->OpenGL_Template属性->C/C+±>常规->附加包含目录->编辑 选中glew文件夹的include和glfw文件夹的include lib文件配置 项目->OpenGL_Template属性->链接器->常规->附加库目录 跟上面同样的操作,把glew和glfw的lib配置好 注意glew的lib要选择glew-2.1.0\lib\Release\Win32,64位的文件会有bug glfw的lib根据编译器版本决定,这里使用vs2019,所以选择lib-vc2019 这一步配置好的效果 最后一步 项目->OpenGL_Template属性->链接器->常规->输入 手动输入opengl32.lib、glfw3.lib、glew32s.lib

GLFW first responder error

别说谁变了你拦得住时间么 提交于 2019-11-29 07:10:43
I am trying to create a simple GLFW window and a succeed but xcode gives me an error: 2016-12-14 10:16:40.412191 CREngine[830:21929] [General] ERROR: Setting <GLFWContentView: 0x100369850> as the first responder for window <GLFWWindow: 0x10033ea00>, but it is in a different window ((null))! This would eventually crash when the view is freed. The first responder will be set to nil. ( 0 AppKit 0x00007fff9710b9a4 -[NSWindow _validateFirstResponder:] + 566 1 AppKit 0x00007fff968fc9eb -[NSWindow _setFirstResponder:] + 31 2 AppKit 0x00007fff969a466a -[NSWindow _realMakeFirstResponder:] + 406 3