Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not working under the osx environment #16

Open
0oneo opened this issue Apr 9, 2018 · 8 comments
Open

not working under the osx environment #16

0oneo opened this issue Apr 9, 2018 · 8 comments

Comments

@0oneo
Copy link

0oneo commented Apr 9, 2018

can anyone make this repo can build under osx

@liningpan
Copy link

Hi, you can check my repo at https://github.com/liningpan/examples . I just fixed some small error, and I haven't started reading the book yet. I know some examples may not running correctly. At least I can compile now

@liningpan
Copy link

I think the original project works fine with Visual Studio under Windows.

@0oneo
Copy link
Author

0oneo commented Jun 7, 2018

thanks, I will give it a try when i am free

@netpoetica
Copy link

@liningpan Do you know what causes on Mac OSX the following issues? I cloned your repo as this one produces so many errors on Mac OSX, and had much more success, but got the following:

Undefined symbols for architecture x86_64:
  "_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)
  "_CVDisplayLinkGetNominalOutputVideoRefreshPeriod", referenced from:
      _vidmodeFromCGDisplayMode 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)
  "_IODisplayCreateInfoDictionary", referenced from:
      _getDisplayName in libglfw3.a(cocoa_monitor.m.o)
  "_IOHIDDeviceCopyMatchingElements", referenced from:
      _matchCallback in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDDeviceGetProperty", referenced from:
      _matchCallback in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDDeviceGetValue", referenced from:
      _getElementValue in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDElementGetLogicalMax", referenced from:
      _addJoystickElement in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDElementGetLogicalMin", referenced from:
      _addJoystickElement in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDElementGetType", referenced from:
      _addJoystickElement in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDElementGetTypeID", referenced from:
      _getElementsCFArrayHandler in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDElementGetUsage", referenced from:
      _addJoystickElement in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDElementGetUsagePage", referenced from:
      _addJoystickElement in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDManagerCreate", referenced from:
      __glfwInitJoysticks in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDManagerOpen", referenced from:
      __glfwInitJoysticks in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDManagerRegisterDeviceMatchingCallback", referenced from:
      __glfwInitJoysticks in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDManagerRegisterDeviceRemovalCallback", referenced from:
      __glfwInitJoysticks in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDManagerScheduleWithRunLoop", referenced from:
      __glfwInitJoysticks in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDManagerSetDeviceMatchingMultiple", referenced from:
      __glfwInitJoysticks in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDValueGetIntegerValue", referenced from:
      _getElementValue in libglfw3.a(iokit_joystick.m.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [bin/12-imageprocessing] Error 1
make[1]: *** [CMakeFiles/12-imageprocessing.dir/all] Error 2
make: *** [all] Error 2

Looks to be something to do with this joystick functionality, but I am not 100% certain

@rayjan0114
Copy link

@liningpan Do you know what causes on Mac OSX the following issues? I cloned your repo as this one produces so many errors on Mac OSX, and had much more success, but got the following:

Undefined symbols for architecture x86_64:
  "_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)
  "_CVDisplayLinkGetNominalOutputVideoRefreshPeriod", referenced from:
      _vidmodeFromCGDisplayMode 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)
  "_IODisplayCreateInfoDictionary", referenced from:
      _getDisplayName in libglfw3.a(cocoa_monitor.m.o)
  "_IOHIDDeviceCopyMatchingElements", referenced from:
      _matchCallback in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDDeviceGetProperty", referenced from:
      _matchCallback in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDDeviceGetValue", referenced from:
      _getElementValue in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDElementGetLogicalMax", referenced from:
      _addJoystickElement in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDElementGetLogicalMin", referenced from:
      _addJoystickElement in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDElementGetType", referenced from:
      _addJoystickElement in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDElementGetTypeID", referenced from:
      _getElementsCFArrayHandler in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDElementGetUsage", referenced from:
      _addJoystickElement in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDElementGetUsagePage", referenced from:
      _addJoystickElement in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDManagerCreate", referenced from:
      __glfwInitJoysticks in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDManagerOpen", referenced from:
      __glfwInitJoysticks in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDManagerRegisterDeviceMatchingCallback", referenced from:
      __glfwInitJoysticks in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDManagerRegisterDeviceRemovalCallback", referenced from:
      __glfwInitJoysticks in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDManagerScheduleWithRunLoop", referenced from:
      __glfwInitJoysticks in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDManagerSetDeviceMatchingMultiple", referenced from:
      __glfwInitJoysticks in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDValueGetIntegerValue", referenced from:
      _getElementValue in libglfw3.a(iokit_joystick.m.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [bin/12-imageprocessing] Error 1
make[1]: *** [CMakeFiles/12-imageprocessing.dir/all] Error 2
make: *** [all] Error 2

Looks to be something to do with this joystick functionality, but I am not 100% certain

try to add " -framework Cocoa -framework IOKit" while compiling on macosx

@yaojingguo
Copy link

After I fix some compile errors: https://github.com/yaojingguo/examples/tree/hacking, make produces:

[ 17%] Linking CXX executable ../bin/12-imageprocessing
ld: library not found for -lGL

After removing -lGL in build/CMakeFiles/12-imageprocessing.dir/link.txt, make produces:

[ 16%] Linking CXX executable ../bin/12-imageprocessing
ld: library not found for -lrt

After removing -lrt in build/CMakeFiles/12-imageprocessing.dir/link.txt, make produces:

[ 16%] Linking CXX executable ../bin/12-imageprocessing
Undefined symbols for architecture x86_64:
  "_CFArrayAppendValue", referenced from:
      __glfwInitJoysticks in libglfw3.a(iokit_joystick.m.o)
      _addJoystickElement in libglfw3.a(iokit_joystick.m.o)
  "_CFArrayApplyFunction", referenced from:
      _matchCallback in libglfw3.a(iokit_joystick.m.o)
  "_CFArrayCreateMutable", referenced from:
      __glfwInitJoysticks in libglfw3.a(iokit_joystick.m.o)
      _matchCallback in libglfw3.a(iokit_joystick.m.o)
  "_CFArrayGetCount", referenced from:
      _matchCallback in libglfw3.a(iokit_joystick.m.o)
      _removeJoystick in libglfw3.a(iokit_joystick.m.o)
      _pollJoystickEvents in libglfw3.a(iokit_joystick.m.o)
      __glfwPlatformGetJoystickAxes in libglfw3.a(iokit_joystick.m.o)
      __glfwPlatformGetJoystickButtons in libglfw3.a(iokit_joystick.m.o)
      __glfwSetVideoMode in libglfw3.a(cocoa_monitor.m.o)
      __glfwPlatformGetVideoModes in libglfw3.a(cocoa_monitor.m.o)
      ...
  "_CFArrayGetValueAtIndex", referenced from:
      _removeJoystick in libglfw3.a(iokit_joystick.m.o)
      _pollJoystickEvents in libglfw3.a(iokit_joystick.m.o)
      __glfwSetVideoMode in libglfw3.a(cocoa_monitor.m.o)
      __glfwPlatformGetVideoModes in libglfw3.a(cocoa_monitor.m.o)
  "_CFArrayRemoveAllValues", referenced from:
      _removeJoystick in libglfw3.a(iokit_joystick.m.o)
  "_CFBundleCopyResourcesDirectoryURL", referenced from:
      _changeToResourcesDirectory in libglfw3.a(cocoa_init.m.o)
  "_CFBundleCreate", referenced from:
      _open_libgl in libvermilion.a(gl3w.c.o)
  "_CFBundleGetBundleWithIdentifier", referenced from:
      __glfwInitContextAPI in libglfw3.a(nsgl_context.m.o)
  "_CFBundleGetFunctionPointerForName", referenced from:
      __glfwPlatformGetProcAddress in libglfw3.a(nsgl_context.m.o)
      _get_proc in libvermilion.a(gl3w.c.o)
  "_CFBundleGetMainBundle", referenced from:
      _changeToResourcesDirectory in libglfw3.a(cocoa_init.m.o)
  "_CFDictionaryCreateMutable", referenced from:
      _createMatchingDictionary in libglfw3.a(iokit_joystick.m.o)
  "_CFDictionaryGetValue", referenced from:
      _getDisplayName in libglfw3.a(cocoa_monitor.m.o)
  "_CFDictionaryGetValueIfPresent", referenced from:
      _getDisplayName in libglfw3.a(cocoa_monitor.m.o)
  "_CFDictionarySetValue", referenced from:
      _createMatchingDictionary in libglfw3.a(iokit_joystick.m.o)
  "_CFGetTypeID", referenced from:
      _getElementsCFArrayHandler in libglfw3.a(iokit_joystick.m.o)
  "_CFNumberCreate", referenced from:
      _createMatchingDictionary in libglfw3.a(iokit_joystick.m.o)
  "_CFRelease", referenced from:
      __glfwPlatformGetProcAddress in libglfw3.a(nsgl_context.m.o)
      _close_libgl in libvermilion.a(gl3w.c.o)
      _get_proc in libvermilion.a(gl3w.c.o)
      __glfwInitJoysticks in libglfw3.a(iokit_joystick.m.o)
      _createMatchingDictionary in libglfw3.a(iokit_joystick.m.o)
      _matchCallback in libglfw3.a(iokit_joystick.m.o)
      __glfwTerminateJoysticks in libglfw3.a(iokit_joystick.m.o)
      ...
  "_CFRunLoopGetMain", referenced from:
      __glfwInitJoysticks in libglfw3.a(iokit_joystick.m.o)
  "_CFRunLoopRunInMode", referenced from:
      __glfwInitJoysticks in libglfw3.a(iokit_joystick.m.o)
  "_CFStringCompare", referenced from:
      _modeIsGood in libglfw3.a(cocoa_monitor.m.o)
      _vidmodeFromCGDisplayMode in libglfw3.a(cocoa_monitor.m.o)
      _changeToResourcesDirectory in libglfw3.a(cocoa_init.m.o)
  "_CFStringCreateWithCString", referenced from:
      __glfwPlatformGetProcAddress in libglfw3.a(nsgl_context.m.o)
      _get_proc in libvermilion.a(gl3w.c.o)
  "_CFStringGetCString", referenced from:
      _matchCallback in libglfw3.a(iokit_joystick.m.o)
      _getDisplayName in libglfw3.a(cocoa_monitor.m.o)
  "_CFStringGetLength", referenced from:
      _getDisplayName in libglfw3.a(cocoa_monitor.m.o)
  "_CFStringGetMaximumSizeForEncoding", referenced from:
      _getDisplayName in libglfw3.a(cocoa_monitor.m.o)
  "_CFURLCopyLastPathComponent", referenced from:
      _changeToResourcesDirectory in libglfw3.a(cocoa_init.m.o)
  "_CFURLCreateWithFileSystemPath", referenced from:
      _open_libgl in libvermilion.a(gl3w.c.o)
  "_CFURLGetFileSystemRepresentation", referenced from:
      _changeToResourcesDirectory in libglfw3.a(cocoa_init.m.o)
  "_CGAcquireDisplayFadeReservation", referenced from:
      _beginFadeReservation in libglfw3.a(cocoa_monitor.m.o)
  "_CGAssociateMouseAndMouseCursorPosition", referenced from:
      __glfwPlatformApplyCursorMode in libglfw3.a(cocoa_window.m.o)
  "_CGDisplayBounds", referenced from:
      _transformY in libglfw3.a(cocoa_window.m.o)
      __glfwPlatformGetMonitorPos in libglfw3.a(cocoa_monitor.m.o)
  "_CGDisplayCopyAllDisplayModes", referenced from:
      __glfwSetVideoMode in libglfw3.a(cocoa_monitor.m.o)
      __glfwPlatformGetVideoModes in libglfw3.a(cocoa_monitor.m.o)
  "_CGDisplayCopyDisplayMode", referenced from:
      __glfwSetVideoMode in libglfw3.a(cocoa_monitor.m.o)
      __glfwPlatformGetVideoMode in libglfw3.a(cocoa_monitor.m.o)
  "_CGDisplayFade", referenced from:
      _beginFadeReservation in libglfw3.a(cocoa_monitor.m.o)
      _endFadeReservation in libglfw3.a(cocoa_monitor.m.o)
  "_CGDisplayGammaTableCapacity", referenced from:
      __glfwPlatformGetGammaRamp in libglfw3.a(cocoa_monitor.m.o)
  "_CGDisplayIOServicePort", referenced from:
      _getDisplayName in libglfw3.a(cocoa_monitor.m.o)
  "_CGDisplayIsAsleep", referenced from:
      __glfwPlatformGetMonitors in libglfw3.a(cocoa_monitor.m.o)
  "_CGDisplayModeCopyPixelEncoding", referenced from:
      _modeIsGood in libglfw3.a(cocoa_monitor.m.o)
      _vidmodeFromCGDisplayMode in libglfw3.a(cocoa_monitor.m.o)
  "_CGDisplayModeGetHeight", referenced from:
      _vidmodeFromCGDisplayMode in libglfw3.a(cocoa_monitor.m.o)
  "_CGDisplayModeGetIOFlags", referenced from:
      _modeIsGood in libglfw3.a(cocoa_monitor.m.o)
  "_CGDisplayModeGetRefreshRate", referenced from:
      _vidmodeFromCGDisplayMode in libglfw3.a(cocoa_monitor.m.o)
  "_CGDisplayModeGetWidth", referenced from:
      _vidmodeFromCGDisplayMode in libglfw3.a(cocoa_monitor.m.o)
  "_CGDisplayModeRelease", referenced from:
      __glfwPlatformGetVideoMode in libglfw3.a(cocoa_monitor.m.o)
      __glfwRestoreVideoMode in libglfw3.a(cocoa_monitor.m.o)
  "_CGDisplayMoveCursorToPoint", referenced from:
      __glfwPlatformSetCursorPos in libglfw3.a(cocoa_window.m.o)
  "_CGDisplayScreenSize", referenced from:
      __glfwPlatformGetMonitors in libglfw3.a(cocoa_monitor.m.o)
  "_CGDisplaySetDisplayMode", referenced from:
      __glfwSetVideoMode in libglfw3.a(cocoa_monitor.m.o)
      __glfwRestoreVideoMode in libglfw3.a(cocoa_monitor.m.o)
  "_CGDisplayUnitNumber", referenced from:
      __glfwPlatformGetMonitors in libglfw3.a(cocoa_monitor.m.o)
  "_CGEventSourceCreate", referenced from:
      __glfwPlatformInit in libglfw3.a(cocoa_init.m.o)
  "_CGEventSourceSetLocalEventsSuppressionInterval", referenced from:
      __glfwPlatformInit in libglfw3.a(cocoa_init.m.o)
  "_CGGetDisplayTransferByTable", referenced from:
      __glfwPlatformGetGammaRamp in libglfw3.a(cocoa_monitor.m.o)
  "_CGGetOnlineDisplayList", referenced from:
      __glfwPlatformGetMonitors in libglfw3.a(cocoa_monitor.m.o)
  "_CGMainDisplayID", referenced from:
      _transformY in libglfw3.a(cocoa_window.m.o)
  "_CGReleaseDisplayFadeReservation", referenced from:
      _endFadeReservation in libglfw3.a(cocoa_monitor.m.o)
  "_CGSetDisplayTransferByTable", referenced from:
      __glfwPlatformSetGammaRamp in libglfw3.a(cocoa_monitor.m.o)
  "_CGWarpMouseCursorPosition", referenced from:
      __glfwPlatformSetCursorPos in libglfw3.a(cocoa_window.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)
  "_CVDisplayLinkGetNominalOutputVideoRefreshPeriod", referenced from:
      _vidmodeFromCGDisplayMode 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)
  "_IODisplayCreateInfoDictionary", referenced from:
      _getDisplayName in libglfw3.a(cocoa_monitor.m.o)
  "_IOHIDDeviceCopyMatchingElements", referenced from:
      _matchCallback in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDDeviceGetProperty", referenced from:
      _matchCallback in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDDeviceGetValue", referenced from:
      _getElementValue in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDElementGetLogicalMax", referenced from:
      _addJoystickElement in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDElementGetLogicalMin", referenced from:
      _addJoystickElement in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDElementGetType", referenced from:
      _addJoystickElement in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDElementGetTypeID", referenced from:
      _getElementsCFArrayHandler in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDElementGetUsage", referenced from:
      _addJoystickElement in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDElementGetUsagePage", referenced from:
      _addJoystickElement in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDManagerCreate", referenced from:
      __glfwInitJoysticks in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDManagerOpen", referenced from:
      __glfwInitJoysticks in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDManagerRegisterDeviceMatchingCallback", referenced from:
      __glfwInitJoysticks in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDManagerRegisterDeviceRemovalCallback", referenced from:
      __glfwInitJoysticks in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDManagerScheduleWithRunLoop", referenced from:
      __glfwInitJoysticks in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDManagerSetDeviceMatchingMultiple", referenced from:
      __glfwInitJoysticks in libglfw3.a(iokit_joystick.m.o)
  "_IOHIDValueGetIntegerValue", referenced from:
      _getElementValue in libglfw3.a(iokit_joystick.m.o)
  "_NSApp", referenced from:
      -[GLFWApplicationDelegate applicationDidFinishLaunching:] in libglfw3.a(cocoa_window.m.o)
      __glfwPlatformPostEmptyEvent in libglfw3.a(cocoa_window.m.o)
      _initializeAppKit in libglfw3.a(cocoa_window.m.o)
      __glfwPlatformShowWindow in libglfw3.a(cocoa_window.m.o)
      __glfwPlatformPollEvents in libglfw3.a(cocoa_window.m.o)
      __glfwPlatformWaitEvents in libglfw3.a(cocoa_window.m.o)
      _createMenuBar in libglfw3.a(cocoa_window.m.o)
      ...
  "_NSAppKitVersionNumber", referenced from:
      _convertRectToBacking in libglfw3.a(cocoa_window.m.o)
      -[GLFWContentView scrollWheel:] in libglfw3.a(cocoa_window.m.o)
      _createWindow in libglfw3.a(cocoa_window.m.o)
      _createMenuBar in libglfw3.a(cocoa_window.m.o)
  "_NSCalibratedRGBColorSpace", referenced from:
      __glfwPlatformCreateCursor in libglfw3.a(cocoa_window.m.o)
  "_NSDefaultRunLoopMode", referenced from:
      __glfwPlatformPollEvents in libglfw3.a(cocoa_window.m.o)
      __glfwPlatformWaitEvents in libglfw3.a(cocoa_window.m.o)
  "_NSFilenamesPboardType", referenced from:
      -[GLFWContentView initWithGlfwWindow:] in libglfw3.a(cocoa_window.m.o)
      -[GLFWContentView performDragOperation:] in libglfw3.a(cocoa_window.m.o)
  "_NSSelectorFromString", referenced from:
      _createMenuBar in libglfw3.a(cocoa_window.m.o)
  "_NSStringPboardType", referenced from:
      __glfwPlatformSetClipboardString in libglfw3.a(cocoa_window.m.o)
      __glfwPlatformGetClipboardString in libglfw3.a(cocoa_window.m.o)
  "_NSZeroPoint", referenced from:
      +[GLFWContentView initialize] in libglfw3.a(cocoa_window.m.o)
  "_OBJC_CLASS_$_NSApplication", referenced from:
      _OBJC_CLASS_$_GLFWApplication in libglfw3.a(cocoa_window.m.o)
  "_OBJC_CLASS_$_NSArray", referenced from:
      objc-class-ref in libglfw3.a(cocoa_window.m.o)
  "_OBJC_CLASS_$_NSAutoreleasePool", referenced from:
      objc-class-ref in libglfw3.a(cocoa_window.m.o)
      objc-class-ref in libglfw3.a(cocoa_init.m.o)
  "_OBJC_CLASS_$_NSBitmapImageRep", referenced from:
      objc-class-ref in libglfw3.a(cocoa_window.m.o)
  "_OBJC_CLASS_$_NSBundle", referenced from:
      objc-class-ref in libglfw3.a(cocoa_window.m.o)
  "_OBJC_CLASS_$_NSCursor", referenced from:
      objc-class-ref in libglfw3.a(cocoa_window.m.o)
  "_OBJC_CLASS_$_NSDate", referenced from:
      objc-class-ref in libglfw3.a(cocoa_window.m.o)
  "_OBJC_CLASS_$_NSEvent", referenced from:
      objc-class-ref in libglfw3.a(cocoa_window.m.o)
  "_OBJC_CLASS_$_NSImage", referenced from:
      objc-class-ref in libglfw3.a(cocoa_window.m.o)
  "_OBJC_CLASS_$_NSMenu", referenced from:
      objc-class-ref in libglfw3.a(cocoa_window.m.o)
  "_OBJC_CLASS_$_NSMenuItem", referenced from:
      objc-class-ref in libglfw3.a(cocoa_window.m.o)
  "_OBJC_CLASS_$_NSObject", referenced from:
      _OBJC_CLASS_$_GLFWWindowDelegate in libglfw3.a(cocoa_window.m.o)
      _OBJC_CLASS_$_GLFWApplicationDelegate in libglfw3.a(cocoa_window.m.o)
  "_OBJC_CLASS_$_NSOpenGLContext", referenced from:
      objc-class-ref in libglfw3.a(nsgl_context.m.o)
  "_OBJC_CLASS_$_NSOpenGLPixelFormat", referenced from:
      objc-class-ref in libglfw3.a(nsgl_context.m.o)
  "_OBJC_CLASS_$_NSPasteboard", referenced from:
      objc-class-ref in libglfw3.a(cocoa_window.m.o)
  "_OBJC_CLASS_$_NSString", referenced from:
      objc-class-ref in libglfw3.a(cocoa_window.m.o)
  "_OBJC_CLASS_$_NSTrackingArea", referenced from:
      objc-class-ref in libglfw3.a(cocoa_window.m.o)
  "_OBJC_CLASS_$_NSView", referenced from:
      _OBJC_CLASS_$_GLFWContentView in libglfw3.a(cocoa_window.m.o)
  "_OBJC_CLASS_$_NSWindow", referenced from:
      _OBJC_CLASS_$_GLFWWindow in libglfw3.a(cocoa_window.m.o)
  "_OBJC_METACLASS_$_NSApplication", referenced from:
      _OBJC_METACLASS_$_GLFWApplication in libglfw3.a(cocoa_window.m.o)
  "_OBJC_METACLASS_$_NSObject", referenced from:
      _OBJC_METACLASS_$_GLFWWindowDelegate in libglfw3.a(cocoa_window.m.o)
      _OBJC_METACLASS_$_GLFWApplicationDelegate in libglfw3.a(cocoa_window.m.o)
      _OBJC_METACLASS_$_GLFWContentView in libglfw3.a(cocoa_window.m.o)
      _OBJC_METACLASS_$_GLFWWindow in libglfw3.a(cocoa_window.m.o)
      _OBJC_METACLASS_$_GLFWApplication in libglfw3.a(cocoa_window.m.o)
  "_OBJC_METACLASS_$_NSView", referenced from:
      _OBJC_METACLASS_$_GLFWContentView in libglfw3.a(cocoa_window.m.o)
  "_OBJC_METACLASS_$_NSWindow", referenced from:
      _OBJC_METACLASS_$_GLFWWindow in libglfw3.a(cocoa_window.m.o)
  "___CFConstantStringClassReference", referenced from:
      CFString in libglfw3.a(cocoa_window.m.o)
      CFString in libglfw3.a(cocoa_window.m.o)
      CFString in libglfw3.a(cocoa_window.m.o)
      CFString in libglfw3.a(cocoa_window.m.o)
      CFString in libglfw3.a(cocoa_window.m.o)
      CFString in libglfw3.a(cocoa_window.m.o)
      CFString in libglfw3.a(cocoa_window.m.o)
      ...
  "__objc_empty_cache", referenced from:
      _OBJC_CLASS_$_GLFWWindowDelegate in libglfw3.a(cocoa_window.m.o)
      _OBJC_METACLASS_$_GLFWWindowDelegate in libglfw3.a(cocoa_window.m.o)
      _OBJC_METACLASS_$_GLFWApplicationDelegate in libglfw3.a(cocoa_window.m.o)
      _OBJC_CLASS_$_GLFWApplicationDelegate in libglfw3.a(cocoa_window.m.o)
      _OBJC_CLASS_$_GLFWContentView in libglfw3.a(cocoa_window.m.o)
      _OBJC_METACLASS_$_GLFWContentView in libglfw3.a(cocoa_window.m.o)
      _OBJC_METACLASS_$_GLFWWindow in libglfw3.a(cocoa_window.m.o)
      ...
  "_kCFAllocatorDefault", referenced from:
      __glfwPlatformGetProcAddress in libglfw3.a(nsgl_context.m.o)
      _open_libgl in libvermilion.a(gl3w.c.o)
      _get_proc in libvermilion.a(gl3w.c.o)
      __glfwInitJoysticks in libglfw3.a(iokit_joystick.m.o)
      _createMatchingDictionary in libglfw3.a(iokit_joystick.m.o)
  "_kCFRunLoopDefaultMode", referenced from:
      __glfwInitJoysticks in libglfw3.a(iokit_joystick.m.o)
  "_kCFTypeArrayCallBacks", referenced from:
      __glfwInitJoysticks in libglfw3.a(iokit_joystick.m.o)
  "_kCFTypeDictionaryKeyCallBacks", referenced from:
      _createMatchingDictionary in libglfw3.a(iokit_joystick.m.o)
  "_kCFTypeDictionaryValueCallBacks", referenced from:
      _createMatchingDictionary in libglfw3.a(iokit_joystick.m.o)
  "_objc_alloc", referenced from:
      +[GLFWContentView initialize] in libglfw3.a(cocoa_window.m.o)
      -[GLFWContentView updateTrackingAreas] in libglfw3.a(cocoa_window.m.o)
      _createWindow in libglfw3.a(cocoa_window.m.o)
      __glfwPlatformCreateCursor in libglfw3.a(cocoa_window.m.o)
      _createMenuBar in libglfw3.a(cocoa_window.m.o)
      __glfwCreateContext in libglfw3.a(nsgl_context.m.o)
  "_objc_alloc_init", referenced from:
      __glfwPlatformPostEmptyEvent in libglfw3.a(cocoa_window.m.o)
      _initializeAppKit in libglfw3.a(cocoa_window.m.o)
      __glfwPlatformPollEvents in libglfw3.a(cocoa_window.m.o)
      _createMenuBar in libglfw3.a(cocoa_window.m.o)
      __glfwPlatformInit in libglfw3.a(cocoa_init.m.o)
  "_objc_msgSend", referenced from:
      -[GLFWWindowDelegate windowDidResize:] in libglfw3.a(cocoa_window.m.o)
      -[GLFWWindowDelegate windowDidMove:] in libglfw3.a(cocoa_window.m.o)
      _enterFullscreenMode in libglfw3.a(cocoa_window.m.o)
      __glfwPlatformIconifyWindow in libglfw3.a(cocoa_window.m.o)
      -[GLFWApplicationDelegate applicationDidFinishLaunching:] in libglfw3.a(cocoa_window.m.o)
      __glfwPlatformPostEmptyEvent in libglfw3.a(cocoa_window.m.o)
      +[GLFWContentView initialize] in libglfw3.a(cocoa_window.m.o)
      ...
  "_objc_msgSendSuper2", referenced from:
      -[GLFWWindowDelegate initWithGlfwWindow:] in libglfw3.a(cocoa_window.m.o)
      -[GLFWContentView initWithGlfwWindow:] in libglfw3.a(cocoa_window.m.o)
      -[GLFWContentView dealloc] in libglfw3.a(cocoa_window.m.o)
      -[GLFWContentView updateTrackingAreas] in libglfw3.a(cocoa_window.m.o)
      -[GLFWApplication sendEvent:] in libglfw3.a(cocoa_window.m.o)
  "_objc_msgSend_stret", referenced from:
      -[GLFWWindowDelegate windowDidResize:] in libglfw3.a(cocoa_window.m.o)
      _convertRectToBacking in libglfw3.a(cocoa_window.m.o)
      __glfwPlatformGetWindowPos in libglfw3.a(cocoa_window.m.o)
      -[GLFWContentView mouseMoved:] in libglfw3.a(cocoa_window.m.o)
      -[GLFWContentView viewDidChangeBackingProperties] in libglfw3.a(cocoa_window.m.o)
      -[GLFWContentView updateTrackingAreas] in libglfw3.a(cocoa_window.m.o)
      -[GLFWContentView performDragOperation:] in libglfw3.a(cocoa_window.m.o)
      ...
  "_objc_opt_class", referenced from:
      +[GLFWContentView initialize] in libglfw3.a(cocoa_window.m.o)
      _findAppName in libglfw3.a(cocoa_window.m.o)
  "_objc_opt_isKindOfClass", referenced from:
      _findAppName in libglfw3.a(cocoa_window.m.o)
  "_objc_release", referenced from:
      +[GLFWContentView initialize] in libglfw3.a(cocoa_window.m.o)
      -[GLFWContentView dealloc] in libglfw3.a(cocoa_window.m.o)
      -[GLFWContentView updateTrackingAreas] in libglfw3.a(cocoa_window.m.o)
      __glfwPlatformDestroyWindow in libglfw3.a(cocoa_window.m.o)
      __glfwPlatformCreateCursor in libglfw3.a(cocoa_window.m.o)
      __glfwPlatformDestroyCursor in libglfw3.a(cocoa_window.m.o)
      _createMenuBar in libglfw3.a(cocoa_window.m.o)
      ...
  "_objc_retain", referenced from:
      __glfwPlatformCreateStandardCursor in libglfw3.a(cocoa_window.m.o)
ld: symbol(s) not found for architecture x86_64

After adding -framework Cocoa -framework IOKit -framework CoreVideo to build/CMakeFiles/12-imageprocessing.dir/link.txt, buidling of 12-imageprocessing succeeds. But the build result 12-imageprocessing does not work.

$ bin/12-imageprocessing
[1]    3112 segmentation fault  bin/12-imageprocessing

@YarikRevich
Copy link

I also had such problem, but afterwards tried to add cocoa, iokit and corevideo to cmake. Then i got no errors. If you get seg fault, it means there is a problem in you app, not in cmake conf

@Xiangao2018
Copy link

i am using cmake to build, and i face this problem too, i link Cocoa and make it ok

cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR)
project(Demo1 VERSION 0.1.0 LANGUAGES CXX C)

add_subdirectory(lib/glfw)

list(APPEND SOURCES src/glad.c)
list(APPEND SOURCES src/main.cpp)

add_executable(Demo1 ${SOURCES})

include_directories(include)

target_link_libraries(Demo1 GLFW)
target_link_libraries(Demo1 "-framework Cocoa")
target_link_libraries(Demo1 "-framework IOKit")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants