This one’s for the Googlers
If you’re getting “Apple Mach-O Linker” errors for symbols like _CVDisplayLinkGetNominalOutputVideoRefreshPeriod
, _CVDisplayLinkCreateWithCGDisplay
and _CVDisplayLinkRelease
then:
add the CoreVideo framework to your project
This is caused by outdated projects which don’t have the CoreVideo framework in their list of frameworks (it’s included in the openFrameworks project but not the ofApp’s project).
- Select your project in the Project Navigator (i.e. the bar on the left)
- Select your app’s target in the pane that just came up (the first entry under “TARGETS”)
- Select the “General” tab if it’s not the one currently selected
- Scroll down to “Linked Frameworks and Libraries”
- Click the + button and add the CoreVideo framework
The whole error message:
Undefined symbols for architecture i386:
"_CVDisplayLinkGetNominalOutputVideoRefreshPeriod", referenced from:
_vidmodeFromCGDisplayMode in libglfw3.a(cocoa_monitor.m.o)
"_CVDisplayLinkCreateWithCGDisplay", referenced from:
__glfwSetVideoMode in libglfw3.a(cocoa_monitor.m.o)
__glfwPlatformGetVideoMode in libglfw3.a(cocoa_monitor.m.o)
__glfwPlatformGetVideoModes in libglfw3.a(cocoa_monitor.m.o)
"_CVDisplayLinkRelease", referenced from:
__glfwSetVideoMode in libglfw3.a(cocoa_monitor.m.o)
__glfwPlatformGetVideoMode in libglfw3.a(cocoa_monitor.m.o)
__glfwPlatformGetVideoModes in libglfw3.a(cocoa_monitor.m.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)