码迷,mamicode.com
首页 > 系统相关 > 详细

Mac OS X 10.10上以命令行模式使用GLWF3

时间:2015-12-16 23:15:40      阅读:1493      评论:0      收藏:0      [点我收藏+]

标签:

GLWF3的介绍请移步其官网:http://www.glfw.org/docs/latest/index.html

 

按照其官网上的安装介绍,用cmake从源码安装GLWF3

 

Building Applications with GLWF3可以见http://www.glfw.org/docs/latest/build.html#build_link_osx

 

但它给的用命令行模式在Mac OS X上使用的方法是不全的,会导致不少错误,比如:

Undefined symbols for architecture x86_64:
  "_LMGetKbdType", referenced from:
      __glfwPlatformGetKeyName in libglfw3.a(cocoa_window.m.o)
  "_TISCopyCurrentKeyboardLayoutInputSource", referenced from:
      __glfwPlatformInit in libglfw3.a(cocoa_init.m.o)
  "_TISGetInputSourceProperty", referenced from:
      __glfwPlatformInit in libglfw3.a(cocoa_init.m.o)
  "_kTISPropertyUnicodeKeyLayoutData", referenced from:
      __glfwPlatformInit in libglfw3.a(cocoa_init.m.o)
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make: *** [myapplicationname] Error 1

 

准确的编译命令是:

cc -o myprog myprog.c -lglfw3 -framework Carbon -framework Cocoa -framework OpenGL -framework IOKit -framework CoreFoundation -framework CoreVideo

 上面的cc要么在环境变量里面定义,要么就换成gcc-mp-x.

Mac OS X 10.10上以命令行模式使用GLWF3

标签:

原文地址:http://www.cnblogs.com/make217/p/5052526.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!