2012-07-20 11 views
8

Problems linking against GLFW in OSXGLFW OSX शेर

पर makefile में इस मुद्दे को जोड़ने मैं यह पहले से ही पढ़ा है, लेकिन यह मेरे साथ एक अलग मुद्दा हो रहा है।

makefile में आदेश जा रहा भाग गया है,

g++ -o main main.cpp -lglfw -framework Cocoa -framework OpenGL 

त्रुटि जब मैं चलाने makefile है कि मैं प्राप्त कर रहा हूँ,

Undefined symbols for architecture x86_64: 
    "_IOMasterPort", referenced from: 
     __glfwInitJoysticks in libglfw.a(cocoa_joystick.o) 
    "_IOServiceMatching", referenced from: 
     __glfwInitJoysticks in libglfw.a(cocoa_joystick.o) 
    "_IOServiceGetMatchingServices", referenced from: 
     __glfwInitJoysticks in libglfw.a(cocoa_joystick.o) 
    "_IOIteratorNext", referenced from: 
    __glfwInitJoysticks in libglfw.a(cocoa_joystick.o) 
    "_IORegistryEntryCreateCFProperties", referenced from: 
     __glfwInitJoysticks in libglfw.a(cocoa_joystick.o) 
    "_IOCreatePlugInInterfaceForService", referenced from: 
     __glfwInitJoysticks in libglfw.a(cocoa_joystick.o) 
ld: symbol(s) not found for architecture x86_64 
collect2: ld returned 1 exit status 
make: *** [all] Error 1 

उत्तर

16

-framework IOKit को जी ++ विकल्प जोड़ें।

+0

आपको बहुत बहुत धन्यवाद! – snarehanger

+0

आपने मेरा दिन बचाया :-) – Mayoneez

+1

बस कुछ विवरण यहां जोड़ना: IOKit ढांचे की आवश्यकता है क्योंकि इसका हाल ही में जोड़ा गया ओएस एक्स जॉयस्टिक समर्थन द्वारा उपयोग किया जाता है। – elmindreda

0

Thsnks @ करने के लिए Mārtiņš Možeiko, मैं समस्या का एक हिस्सा हल, लेकिन मेरे लिए वहाँ अभी भी कुछ त्रुटि संदेश थे:

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) 
ld: symbol(s) not found for architecture x86_64 
clang: error: linker command failed with exit code 1 (use -v to see invocation) 
make[1]: *** [scop] Error 1 
make: *** [scop] Error 2 

इसे हल करने के लिए, मैं भी CoreVideo ढांचे को जोड़ने की जरूरत है।

-framework Cocoa -framework IOKit -framework CoreVideo -framework OpenGL