Comments (9)
Finally fixed it.
As i understood, since the last macos update, developers now also need to link -framework QuartzCore
on linking stage,
so we can say that for today, it's not enough to link only these -framework Cocoa -framework OpenGL -framework IOKit
from glfw.
See:
https://www.glfw.org/docs/latest/build_guide.html#build_link_osx
Also you might find it easier to use this cmake starter to generate your makefile or XCode project:
https://github.com/juliettef/GLFW-CMake-starter
from glfw.
It looks like Apple has changed some code in their Cocoa library so GLFW tries to call wrong function.
Maybe GLFW needs some, hotfix?, for this problem ?
from glfw.
Have you tried cloning the source from git and then using CMake to build GLFW with tests and examples, or alternatively using the GLFW-CMake-starter and following the instructions in the readme to build?
from glfw.
Yes. I added the glfw repo as a submodule and successfully compiled it with cd lib/glfw && cmake . && make
But the problems starts while linking
Also i tried to build some examples and got the same linking error:
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_CAMetalLayer", referenced from:
in libglfw3.a[21](cocoa_window.m.o)
ld: symbol(s) not found for architecture arm64
from glfw.
It's something about cocoa_window.m
file in glfw
from glfw.
If you have successfully compiled GLFW with cmake and make then you should also have compiled and linked the tests and examples, so the problem is not with linking to GLFW in general but how you are linking to it. So you should see there are test executables built in the tests
folder, and examples in the examples
folder.
As mentioned you could check the documentation on how to compile and link to GLFW on MacOS, or use the GLFW-CMake-starter. If either of these fail then let us know here along with the details.
from glfw.
Also note that, i guess, ALL latest versions of macos (for example: BigSur, Monterey, Ventura) need this additional framework while linking (since i downgraded macos from Sonoma to BigSur and the problem still was there:( )
Would be pretty lovely if some contributor updates information about this at https://www.glfw.org/docs/latest/build_guide.html#build_link_osx
from glfw.
I see there's some guy who has already fixed this in documentation coming with sources but not on the website (since last website update was on Fri Feb 23 2024)
from glfw.
Related Issues (20)
- compile error version 3.4 HOT 1
- wctype.h file not found | required in glfw/src/win32_platform.h
- VkWin32SurfaceCreateInfoKHR not found nor is the function prototype PFN_vkCreateWin32SurfaceKHR
- GLFW_DECORATED set false cause vsync HOT 1
- Drastic decrease in performance when running full screen vs almost full screen
- GLFW Wayland Support HOT 8
- Crash on my computer HOT 3
- Compilation issues with single file builds (Unity Builds) HOT 10
- GLFW window crashes after copying/cutting data to clipboard on Hyprland Wayland compositor HOT 1
- IS this a bug: sharing.c example, should resize of window independent to each other. HOT 5
- Ubuntu can't run glfwGetX11Display is null HOT 3
- Window triggers size callback setting the width and height to 0 when minimized on Windows 11 HOT 5
- Compatibility of glfw with the Apple software render in github CI HOT 8
- Question - Mouse passthrough and transparent window - click changing focus? HOT 4
- Compatibility of linux headless tests within Github CI HOT 1
- windows breakpoint triggered in ntdll.dll HOT 1
- 3.4: issue with generated glfw3.pc file
- feature request: Support FriendlyName External Primary HOT 1
- cmake fetchcontent failing with 3.4 dynamic linking HOT 1
- Compile error using MacOS
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from glfw.