我正在尝试编译GLFW以与cygwin中的pyglfw一起使用。
使用正常的cmake标志编译GLFW无法正常工作,boing.exe示例无法编译。 这是Makefile输出的详细版本。
/usr/bin/cmake.exe -H/build/glfw-latest150107 -B/build/glfw-latest150107 --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake.exe -E cmake_progress_start /build/glfw-latest150107/CMakeFiles /build/glfw-latest150107/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/build/glfw-latest150107'
make -f src/CMakeFiles/glfw.dir/build.make src/CMakeFiles/glfw.dir/depend
make[2]: Entering directory '/build/glfw-latest150107'
cd /build/glfw-latest150107 && /usr/bin/cmake.exe -E cmake_depends "Unix Makefiles" /build/glfw-latest150107 /build/glfw-latest150107/src /build/glfw-latest150107 /build/glfw-latest150107/src /build/glfw-latest150107/src/CMakeFiles/glfw.dir/DependInfo.cmake --color=
Scanning dependencies of target glfw
make[2]: Leaving directory '/build/glfw-latest150107'
make -f src/CMakeFiles/glfw.dir/build.make src/CMakeFiles/glfw.dir/build
make[2]: Entering directory '/build/glfw-latest150107'
/usr/bin/cmake.exe -E cmake_progress_report /build/glfw-latest150107/CMakeFiles 13
[ 2%] Building C object src/CMakeFiles/glfw.dir/clipboard.c.o
cd /build/glfw-latest150107/src && /usr/bin/cc -D_GLFW_USE_CONFIG_H -I/build/glfw-latest150107/src -I/usr/local/include -Wall -o CMakeFiles/glfw.dir/clipboard.c.o -c /build/glfw-latest150107/src/clipboard.c
/usr/bin/cmake.exe -E cmake_progress_report /build/glfw-latest150107/CMakeFiles 14
[ 4%] Building C object src/CMakeFiles/glfw.dir/context.c.o
cd /build/glfw-latest150107/src && /usr/bin/cc -D_GLFW_USE_CONFIG_H -I/build/glfw-latest150107/src -I/usr/local/include -Wall -o CMakeFiles/glfw.dir/context.c.o -c /build/glfw-latest150107/src/context.c
/usr/bin/cmake.exe -E cmake_progress_report /build/glfw-latest150107/CMakeFiles 15
[ 6%] Building C object src/CMakeFiles/glfw.dir/gamma.c.o
cd /build/glfw-latest150107/src && /usr/bin/cc -D_GLFW_USE_CONFIG_H -I/build/glfw-latest150107/src -I/usr/local/include -Wall -o CMakeFiles/glfw.dir/gamma.c.o -c /build/glfw-latest150107/src/gamma.c
/usr/bin/cmake.exe -E cmake_progress_report /build/glfw-latest150107/CMakeFiles 16
[ 8%] Building C object src/CMakeFiles/glfw.dir/init.c.o
cd /build/glfw-latest150107/src && /usr/bin/cc -D_GLFW_USE_CONFIG_H -I/build/glfw-latest150107/src -I/usr/local/include -Wall -o CMakeFiles/glfw.dir/init.c.o -c /build/glfw-latest150107/src/init.c
/usr/bin/cmake.exe -E cmake_progress_report /build/glfw-latest150107/CMakeFiles 17
[ 10%] Building C object src/CMakeFiles/glfw.dir/input.c.o
cd /build/glfw-latest150107/src && /usr/bin/cc -D_GLFW_USE_CONFIG_H -I/build/glfw-latest150107/src -I/usr/local/include -Wall -o CMakeFiles/glfw.dir/input.c.o -c /build/glfw-latest150107/src/input.c
/usr/bin/cmake.exe -E cmake_progress_report /build/glfw-latest150107/CMakeFiles 18
[ 12%] Building C object src/CMakeFiles/glfw.dir/joystick.c.o
cd /build/glfw-latest150107/src && /usr/bin/cc -D_GLFW_USE_CONFIG_H -I/build/glfw-latest150107/src -I/usr/local/include -Wall -o CMakeFiles/glfw.dir/joystick.c.o -c /build/glfw-latest150107/src/joystick.c
/usr/bin/cmake.exe -E cmake_progress_report /build/glfw-latest150107/CMakeFiles 19
[ 14%] Building C object src/CMakeFiles/glfw.dir/monitor.c.o
cd /build/glfw-latest150107/src && /usr/bin/cc -D_GLFW_USE_CONFIG_H -I/build/glfw-latest150107/src -I/usr/local/include -Wall -o CMakeFiles/glfw.dir/monitor.c.o -c /build/glfw-latest150107/src/monitor.c
/usr/bin/cmake.exe -E cmake_progress_report /build/glfw-latest150107/CMakeFiles 20
[ 16%] Building C object src/CMakeFiles/glfw.dir/time.c.o
cd /build/glfw-latest150107/src && /usr/bin/cc -D_GLFW_USE_CONFIG_H -I/build/glfw-latest150107/src -I/usr/local/include -Wall -o CMakeFiles/glfw.dir/time.c.o -c /build/glfw-latest150107/src/time.c
/usr/bin/cmake.exe -E cmake_progress_report /build/glfw-latest150107/CMakeFiles 21
[ 18%] Building C object src/CMakeFiles/glfw.dir/window.c.o
cd /build/glfw-latest150107/src && /usr/bin/cc -D_GLFW_USE_CONFIG_H -I/build/glfw-latest150107/src -I/usr/local/include -Wall -o CMakeFiles/glfw.dir/window.c.o -c /build/glfw-latest150107/src/window.c
/usr/bin/cmake.exe -E cmake_progress_report /build/glfw-latest150107/CMakeFiles 22
[ 20%] Building C object src/CMakeFiles/glfw.dir/x11_clipboard.c.o
cd /build/glfw-latest150107/src && /usr/bin/cc -D_GLFW_USE_CONFIG_H -I/build/glfw-latest150107/src -I/usr/local/include -Wall -o CMakeFiles/glfw.dir/x11_clipboard.c.o -c /build/glfw-latest150107/src/x11_clipboard.c
/usr/bin/cmake.exe -E cmake_progress_report /build/glfw-latest150107/CMakeFiles 23
[ 22%] Building C object src/CMakeFiles/glfw.dir/x11_gamma.c.o
cd /build/glfw-latest150107/src && /usr/bin/cc -D_GLFW_USE_CONFIG_H -I/build/glfw-latest150107/src -I/usr/local/include -Wall -o CMakeFiles/glfw.dir/x11_gamma.c.o -c /build/glfw-latest150107/src/x11_gamma.c
/usr/bin/cmake.exe -E cmake_progress_report /build/glfw-latest150107/CMakeFiles 24
[ 24%] Building C object src/CMakeFiles/glfw.dir/x11_init.c.o
cd /build/glfw-latest150107/src && /usr/bin/cc -D_GLFW_USE_CONFIG_H -I/build/glfw-latest150107/src -I/usr/local/include -Wall -o CMakeFiles/glfw.dir/x11_init.c.o -c /build/glfw-latest150107/src/x11_init.c
/usr/bin/cmake.exe -E cmake_progress_report /build/glfw-latest150107/CMakeFiles 25
[ 26%] Building C object src/CMakeFiles/glfw.dir/x11_joystick.c.o
cd /build/glfw-latest150107/src && /usr/bin/cc -D_GLFW_USE_CONFIG_H -I/build/glfw-latest150107/src -I/usr/local/include -Wall -o CMakeFiles/glfw.dir/x11_joystick.c.o -c /build/glfw-latest150107/src/x11_joystick.c
/build/glfw-latest150107/src/x11_joystick.c:47:12: warning: ‘openJoystickDevice’ defined but not used [-Wunused-function]
static int openJoystickDevice(int joy, const char* path)
^
/usr/bin/cmake.exe -E cmake_progress_report /build/glfw-latest150107/CMakeFiles 26
[ 28%] Building C object src/CMakeFiles/glfw.dir/x11_monitor.c.o
cd /build/glfw-latest150107/src && /usr/bin/cc -D_GLFW_USE_CONFIG_H -I/build/glfw-latest150107/src -I/usr/local/include -Wall -o CMakeFiles/glfw.dir/x11_monitor.c.o -c /build/glfw-latest150107/src/x11_monitor.c
/usr/bin/cmake.exe -E cmake_progress_report /build/glfw-latest150107/CMakeFiles 27
[ 30%] Building C object src/CMakeFiles/glfw.dir/x11_time.c.o
cd /build/glfw-latest150107/src && /usr/bin/cc -D_GLFW_USE_CONFIG_H -I/build/glfw-latest150107/src -I/usr/local/include -Wall -o CMakeFiles/glfw.dir/x11_time.c.o -c /build/glfw-latest150107/src/x11_time.c
/usr/bin/cmake.exe -E cmake_progress_report /build/glfw-latest150107/CMakeFiles 28
[ 32%] Building C object src/CMakeFiles/glfw.dir/x11_window.c.o
cd /build/glfw-latest150107/src && /usr/bin/cc -D_GLFW_USE_CONFIG_H -I/build/glfw-latest150107/src -I/usr/local/include -Wall -o CMakeFiles/glfw.dir/x11_window.c.o -c /build/glfw-latest150107/src/x11_window.c
/usr/bin/cmake.exe -E cmake_progress_report /build/glfw-latest150107/CMakeFiles 29
[ 34%] Building C object src/CMakeFiles/glfw.dir/x11_unicode.c.o
cd /build/glfw-latest150107/src && /usr/bin/cc -D_GLFW_USE_CONFIG_H -I/build/glfw-latest150107/src -I/usr/local/include -Wall -o CMakeFiles/glfw.dir/x11_unicode.c.o -c /build/glfw-latest150107/src/x11_unicode.c
/usr/bin/cmake.exe -E cmake_progress_report /build/glfw-latest150107/CMakeFiles 30
[ 36%] Building C object src/CMakeFiles/glfw.dir/glx_context.c.o
cd /build/glfw-latest150107/src && /usr/bin/cc -D_GLFW_USE_CONFIG_H -I/build/glfw-latest150107/src -I/usr/local/include -Wall -o CMakeFiles/glfw.dir/glx_context.c.o -c /build/glfw-latest150107/src/glx_context.c
Linking C static library libglfw3.a
cd /build/glfw-latest150107/src && /usr/bin/cmake.exe -P CMakeFiles/glfw.dir/cmake_clean_target.cmake
cd /build/glfw-latest150107/src && /usr/bin/cmake.exe -E cmake_link_script CMakeFiles/glfw.dir/link.txt --verbose=1
/usr/bin/ar.exe cr libglfw3.a CMakeFiles/glfw.dir/clipboard.c.o CMakeFiles/glfw.dir/context.c.o CMakeFiles/glfw.dir/gamma.c.o CMakeFiles/glfw.dir/init.c.o CMakeFiles/glfw.dir/input.c.o CMakeFiles/glfw.dir/joystick.c.o CMakeFiles/glfw.dir/monitor.c.o CMakeFiles/glfw.dir/time.c.o CMakeFiles/glfw.dir/window.c.o CMakeFiles/glfw.dir/x11_clipboard.c.o CMakeFiles/glfw.dir/x11_gamma.c.o CMakeFiles/glfw.dir/x11_init.c.o CMakeFiles/glfw.dir/x11_joystick.c.o CMakeFiles/glfw.dir/x11_monitor.c.o CMakeFiles/glfw.dir/x11_time.c.o CMakeFiles/glfw.dir/x11_window.c.o CMakeFiles/glfw.dir/x11_unicode.c.o CMakeFiles/glfw.dir/glx_context.c.o
/usr/bin/ranlib.exe libglfw3.a
make[2]: Leaving directory '/build/glfw-latest150107'
/usr/bin/cmake.exe -E cmake_progress_report /build/glfw-latest150107/CMakeFiles 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
[ 36%] Built target glfw
make -f examples/CMakeFiles/boing.dir/build.make examples/CMakeFiles/boing.dir/depend
make[2]: Entering directory '/build/glfw-latest150107'
cd /build/glfw-latest150107 && /usr/bin/cmake.exe -E cmake_depends "Unix Makefiles" /build/glfw-latest150107 /build/glfw-latest150107/examples /build/glfw-latest150107 /build/glfw-latest150107/examples /build/glfw-latest150107/examples/CMakeFiles/boing.dir/DependInfo.cmake --color=
Scanning dependencies of target boing
make[2]: Leaving directory '/build/glfw-latest150107'
make -f examples/CMakeFiles/boing.dir/build.make examples/CMakeFiles/boing.dir/build
make[2]: Entering directory '/build/glfw-latest150107'
/usr/bin/cmake.exe -E cmake_progress_report /build/glfw-latest150107/CMakeFiles 2
[ 38%] Building C object examples/CMakeFiles/boing.dir/boing.c.o
cd /build/glfw-latest150107/examples && /usr/bin/cc -I/build/glfw-latest150107/include -I/build/glfw-latest150107/deps -Wall -o CMakeFiles/boing.dir/boing.c.o -c /build/glfw-latest150107/examples/boing.c
Linking C executable boing.exe
cd /build/glfw-latest150107/examples && /usr/bin/cmake.exe -E cmake_link_script CMakeFiles/boing.dir/link.txt --verbose=1
/usr/bin/cc -Wl,--enable-auto-import -mwindows CMakeFiles/boing.dir/boing.c.o -o boing.exe -Wl,--out-implib,libboing.dll.a -Wl,--major-image-version,0,--minor-image-version,0 ../src/libglfw3.a /usr/local/lib/libGLU.dll.a -lX11 -Wl,-Bstatic -lrt -Wl,-Bdynamic -lXrandr -lXi /usr/local/lib/libXxf86vm.a -Wl,-Bstatic -lrt -lm -Wl,-Bdynamic -lGL -lXrandr -lXi /usr/local/lib/libXxf86vm.a -Wl,-Bstatic -lm -Wl,-Bdynamic -lGL
/usr/local/lib/libXxf86vm.a(XF86VMode.o): In function `find_display':
/build/libXxf86vm-1.1.2/src/XF86VMode.c:75: undefined reference to `XextFindDisplay'
/build/libXxf86vm-1.1.2/src/XF86VMode.c:75:(.text+0x18): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `XextFindDisplay'
/build/libXxf86vm-1.1.2/src/XF86VMode.c:75: undefined reference to `XextCreateExtension'
/build/libXxf86vm-1.1.2/src/XF86VMode.c:75:(.text+0x31): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `XextCreateExtension'
/build/libXxf86vm-1.1.2/src/XF86VMode.c:75: undefined reference to `XextAddDisplay'
/build/libXxf86vm-1.1.2/src/XF86VMode.c:75:(.text+0x7a): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `XextAddDisplay'
/usr/local/lib/libXxf86vm.a(XF86VMode.o): In function `XF86VidModeSetClientVersion':
/build/libXxf86vm-1.1.2/src/XF86VMode.c:139: undefined reference to `_XGetRequest'
/build/libXxf86vm-1.1.2/src/XF86VMode.c:139:(.text+0x11d): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_XGetRequest'
/build/libXxf86vm-1.1.2/src/XF86VMode.c:136: undefined reference to `XMissingExtension'
/build/libXxf86vm-1.1.2/src/XF86VMode.c:136:(.text+0x181): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `XMissingExtension'
/usr/local/lib/libXxf86vm.a(XF86VMode.o): In function `XF86VidModeQueryVersion':
/build/libXxf86vm-1.1.2/src/XF86VMode.c:113: undefined reference to `_XGetRequest'
/build/libXxf86vm-1.1.2/src/XF86VMode.c:113:(.text+0x1da): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_XGetRequest'
/build/libXxf86vm-1.1.2/src/XF86VMode.c:116: undefined reference to `_XReply'
/build/libXxf86vm-1.1.2/src/XF86VMode.c:116:(.text+0x1fa): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_XReply'
/build/libXxf86vm-1.1.2/src/XF86VMode.c:110: undefined reference to `XMissingExtension'
/build/libXxf86vm-1.1.2/src/XF86VMode.c:110:(.text+0x28e): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `XMissingExtension'
/usr/local/lib/libXxf86vm.a(XF86VMode.o): In function `XF86VidModeSetGamma':
/build/libXxf86vm-1.1.2/src/XF86VMode.c:158: undefined reference to `_XGetRequest'
/build/libXxf86vm-1.1.2/src/XF86VMode.c:158:(.text+0x2ec): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_XGetRequest'
/build/libXxf86vm-1.1.2/src/XF86VMode.c:155: undefined reference to `XMissingExtension'
/build/libXxf86vm-1.1.2/src/XF86VMode.c:155:(.text+0x38d): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `XMissingExtension'
/usr/local/lib/libXxf86vm.a(XF86VMode.o): In function `XF86VidModeGetGamma':
/build/libXxf86vm-1.1.2/src/XF86VMode.c:180: undefined reference to `_XGetRequest'
/build/libXxf86vm-1.1.2/src/XF86VMode.c:180:(.text+0x3ec): additional relocation overflows omitted from the output
/build/libXxf86vm-1.1.2/src/XF86VMode.c:184: undefined reference to `_XReply'
/build/libXxf86vm-1.1.2/src/XF86VMode.c:177: undefined reference to `XMissingExtension'
/usr/local/lib/libXxf86vm.a(XF86VMode.o): In function `XF86VidModeGetModeLine':
/build/libXxf86vm-1.1.2/src/XF86VMode.c:211: undefined reference to `_XGetRequest'
/build/libXxf86vm-1.1.2/src/XF86VMode.c:236: undefined reference to `_XReply'
####
# Ommited some lines, you get the basic idea
####
/usr/local/lib/libXxf86vm.a(XF86VMode.o): In function `close_display':
/build/libXxf86vm-1.1.2/src/XF86VMode.c:80: undefined reference to `XextRemoveDisplay'
collect2: error: ld returned 1 exit status
examples/CMakeFiles/boing.dir/build.make:106: recipe for target 'examples/boing.exe' failed
make[2]: *** [examples/boing.exe] Error 1
make[2]: Leaving directory '/build/glfw-latest150107'
CMakeFiles/Makefile2:172: recipe for target 'examples/CMakeFiles/boing.dir/all' failed
make[1]: *** [examples/CMakeFiles/boing.dir/all] Error 2
make[1]: Leaving directory '/build/glfw-latest150107'
Makefile:119: recipe for target 'all' failed
make: *** [all] Error 2
要将glfw与pyglfw一起使用,我必须在ccmake中使用BUILD_SHARED_LIBS=1
选项。
我已经从源代码编译和安装了libXxf86vm,但令我困扰的是我为这些函数调用的src被调用(?),不应该使用/usr/local/lib/
中的.dll文件
/usr/local/lib/libXxf86vm.a(XF86VMode.o): In function `close_display':
/build/libXxf86vm-1.1.2/src/XF86VMode.c:80: undefined reference to `XextRemoveDisplay'
要实际安装libXxf86vm,我必须编译并安装xf86vidmodeproto
,但现在这对我有效(我认为)。
现在Makefile输出BUILD_SHARED_LIBS=1
。
/usr/bin/cmake.exe -H/build/glfw-latest150107 -B/build/glfw-latest150107 --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake.exe -E cmake_progress_start /build/glfw-latest150107/CMakeFiles /build/glfw-latest150107/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/build/glfw-latest150107'
make -f src/CMakeFiles/glfw.dir/build.make src/CMakeFiles/glfw.dir/depend
make[2]: Entering directory '/build/glfw-latest150107'
cd /build/glfw-latest150107 && /usr/bin/cmake.exe -E cmake_depends "Unix Makefiles" /build/glfw-latest150107 /build/glfw-latest150107/src /build/glfw-latest150107 /build/glfw-latest150107/src /build/glfw-latest150107/src/CMakeFiles/glfw.dir/DependInfo.cmake --color=
Scanning dependencies of target glfw
make[2]: Leaving directory '/build/glfw-latest150107'
make -f src/CMakeFiles/glfw.dir/build.make src/CMakeFiles/glfw.dir/build
make[2]: Entering directory '/build/glfw-latest150107'
/usr/bin/cmake.exe -E cmake_progress_report /build/glfw-latest150107/CMakeFiles 13
[ 2%] Building C object src/CMakeFiles/glfw.dir/clipboard.c.o
cd /build/glfw-latest150107/src && /usr/bin/cc -D_GLFW_USE_CONFIG_H -Dglfw_EXPORTS -I/build/glfw-latest150107/src -I/usr/local/include -Wall -fvisibility=hidden -o CMakeFiles/glfw.dir/clipboard.c.o -c /build/glfw-latest150107/src/clipboard.c
/usr/bin/cmake.exe -E cmake_progress_report /build/glfw-latest150107/CMakeFiles 14
[ 4%] Building C object src/CMakeFiles/glfw.dir/context.c.o
cd /build/glfw-latest150107/src && /usr/bin/cc -D_GLFW_USE_CONFIG_H -Dglfw_EXPORTS -I/build/glfw-latest150107/src -I/usr/local/include -Wall -fvisibility=hidden -o CMakeFiles/glfw.dir/context.c.o -c /build/glfw-latest150107/src/context.c
/usr/bin/cmake.exe -E cmake_progress_report /build/glfw-latest150107/CMakeFiles 15
[ 6%] Building C object src/CMakeFiles/glfw.dir/gamma.c.o
cd /build/glfw-latest150107/src && /usr/bin/cc -D_GLFW_USE_CONFIG_H -Dglfw_EXPORTS -I/build/glfw-latest150107/src -I/usr/local/include -Wall -fvisibility=hidden -o CMakeFiles/glfw.dir/gamma.c.o -c /build/glfw-latest150107/src/gamma.c
/usr/bin/cmake.exe -E cmake_progress_report /build/glfw-latest150107/CMakeFiles 16
[ 8%] Building C object src/CMakeFiles/glfw.dir/init.c.o
cd /build/glfw-latest150107/src && /usr/bin/cc -D_GLFW_USE_CONFIG_H -Dglfw_EXPORTS -I/build/glfw-latest150107/src -I/usr/local/include -Wall -fvisibility=hidden -o CMakeFiles/glfw.dir/init.c.o -c /build/glfw-latest150107/src/init.c
/usr/bin/cmake.exe -E cmake_progress_report /build/glfw-latest150107/CMakeFiles 17
[ 10%] Building C object src/CMakeFiles/glfw.dir/input.c.o
cd /build/glfw-latest150107/src && /usr/bin/cc -D_GLFW_USE_CONFIG_H -Dglfw_EXPORTS -I/build/glfw-latest150107/src -I/usr/local/include -Wall -fvisibility=hidden -o CMakeFiles/glfw.dir/input.c.o -c /build/glfw-latest150107/src/input.c
/usr/bin/cmake.exe -E cmake_progress_report /build/glfw-latest150107/CMakeFiles 18
[ 12%] Building C object src/CMakeFiles/glfw.dir/joystick.c.o
cd /build/glfw-latest150107/src && /usr/bin/cc -D_GLFW_USE_CONFIG_H -Dglfw_EXPORTS -I/build/glfw-latest150107/src -I/usr/local/include -Wall -fvisibility=hidden -o CMakeFiles/glfw.dir/joystick.c.o -c /build/glfw-latest150107/src/joystick.c
/usr/bin/cmake.exe -E cmake_progress_report /build/glfw-latest150107/CMakeFiles 19
[ 14%] Building C object src/CMakeFiles/glfw.dir/monitor.c.o
cd /build/glfw-latest150107/src && /usr/bin/cc -D_GLFW_USE_CONFIG_H -Dglfw_EXPORTS -I/build/glfw-latest150107/src -I/usr/local/include -Wall -fvisibility=hidden -o CMakeFiles/glfw.dir/monitor.c.o -c /build/glfw-latest150107/src/monitor.c
/usr/bin/cmake.exe -E cmake_progress_report /build/glfw-latest150107/CMakeFiles 20
[ 16%] Building C object src/CMakeFiles/glfw.dir/time.c.o
cd /build/glfw-latest150107/src && /usr/bin/cc -D_GLFW_USE_CONFIG_H -Dglfw_EXPORTS -I/build/glfw-latest150107/src -I/usr/local/include -Wall -fvisibility=hidden -o CMakeFiles/glfw.dir/time.c.o -c /build/glfw-latest150107/src/time.c
/usr/bin/cmake.exe -E cmake_progress_report /build/glfw-latest150107/CMakeFiles 21
[ 18%] Building C object src/CMakeFiles/glfw.dir/window.c.o
cd /build/glfw-latest150107/src && /usr/bin/cc -D_GLFW_USE_CONFIG_H -Dglfw_EXPORTS -I/build/glfw-latest150107/src -I/usr/local/include -Wall -fvisibility=hidden -o CMakeFiles/glfw.dir/window.c.o -c /build/glfw-latest150107/src/window.c
/usr/bin/cmake.exe -E cmake_progress_report /build/glfw-latest150107/CMakeFiles 22
[ 20%] Building C object src/CMakeFiles/glfw.dir/x11_clipboard.c.o
cd /build/glfw-latest150107/src && /usr/bin/cc -D_GLFW_USE_CONFIG_H -Dglfw_EXPORTS -I/build/glfw-latest150107/src -I/usr/local/include -Wall -fvisibility=hidden -o CMakeFiles/glfw.dir/x11_clipboard.c.o -c /build/glfw-latest150107/src/x11_clipboard.c
/usr/bin/cmake.exe -E cmake_progress_report /build/glfw-latest150107/CMakeFiles 23
[ 22%] Building C object src/CMakeFiles/glfw.dir/x11_gamma.c.o
cd /build/glfw-latest150107/src && /usr/bin/cc -D_GLFW_USE_CONFIG_H -Dglfw_EXPORTS -I/build/glfw-latest150107/src -I/usr/local/include -Wall -fvisibility=hidden -o CMakeFiles/glfw.dir/x11_gamma.c.o -c /build/glfw-latest150107/src/x11_gamma.c
/usr/bin/cmake.exe -E cmake_progress_report /build/glfw-latest150107/CMakeFiles 24
[ 24%] Building C object src/CMakeFiles/glfw.dir/x11_init.c.o
cd /build/glfw-latest150107/src && /usr/bin/cc -D_GLFW_USE_CONFIG_H -Dglfw_EXPORTS -I/build/glfw-latest150107/src -I/usr/local/include -Wall -fvisibility=hidden -o CMakeFiles/glfw.dir/x11_init.c.o -c /build/glfw-latest150107/src/x11_init.c
/usr/bin/cmake.exe -E cmake_progress_report /build/glfw-latest150107/CMakeFiles 25
[ 26%] Building C object src/CMakeFiles/glfw.dir/x11_joystick.c.o
cd /build/glfw-latest150107/src && /usr/bin/cc -D_GLFW_USE_CONFIG_H -Dglfw_EXPORTS -I/build/glfw-latest150107/src -I/usr/local/include -Wall -fvisibility=hidden -o CMakeFiles/glfw.dir/x11_joystick.c.o -c /build/glfw-latest150107/src/x11_joystick.c
/build/glfw-latest150107/src/x11_joystick.c:47:12: warning: ‘openJoystickDevice’ defined but not used [-Wunused-function]
static int openJoystickDevice(int joy, const char* path)
^
/usr/bin/cmake.exe -E cmake_progress_report /build/glfw-latest150107/CMakeFiles 26
[ 28%] Building C object src/CMakeFiles/glfw.dir/x11_monitor.c.o
cd /build/glfw-latest150107/src && /usr/bin/cc -D_GLFW_USE_CONFIG_H -Dglfw_EXPORTS -I/build/glfw-latest150107/src -I/usr/local/include -Wall -fvisibility=hidden -o CMakeFiles/glfw.dir/x11_monitor.c.o -c /build/glfw-latest150107/src/x11_monitor.c
/usr/bin/cmake.exe -E cmake_progress_report /build/glfw-latest150107/CMakeFiles 27
[ 30%] Building C object src/CMakeFiles/glfw.dir/x11_time.c.o
cd /build/glfw-latest150107/src && /usr/bin/cc -D_GLFW_USE_CONFIG_H -Dglfw_EXPORTS -I/build/glfw-latest150107/src -I/usr/local/include -Wall -fvisibility=hidden -o CMakeFiles/glfw.dir/x11_time.c.o -c /build/glfw-latest150107/src/x11_time.c
/usr/bin/cmake.exe -E cmake_progress_report /build/glfw-latest150107/CMakeFiles 28
[ 32%] Building C object src/CMakeFiles/glfw.dir/x11_window.c.o
cd /build/glfw-latest150107/src && /usr/bin/cc -D_GLFW_USE_CONFIG_H -Dglfw_EXPORTS -I/build/glfw-latest150107/src -I/usr/local/include -Wall -fvisibility=hidden -o CMakeFiles/glfw.dir/x11_window.c.o -c /build/glfw-latest150107/src/x11_window.c
/usr/bin/cmake.exe -E cmake_progress_report /build/glfw-latest150107/CMakeFiles 29
[ 34%] Building C object src/CMakeFiles/glfw.dir/x11_unicode.c.o
cd /build/glfw-latest150107/src && /usr/bin/cc -D_GLFW_USE_CONFIG_H -Dglfw_EXPORTS -I/build/glfw-latest150107/src -I/usr/local/include -Wall -fvisibility=hidden -o CMakeFiles/glfw.dir/x11_unicode.c.o -c /build/glfw-latest150107/src/x11_unicode.c
/usr/bin/cmake.exe -E cmake_progress_report /build/glfw-latest150107/CMakeFiles 30
[ 36%] Building C object src/CMakeFiles/glfw.dir/glx_context.c.o
cd /build/glfw-latest150107/src && /usr/bin/cc -D_GLFW_USE_CONFIG_H -Dglfw_EXPORTS -I/build/glfw-latest150107/src -I/usr/local/include -Wall -fvisibility=hidden -o CMakeFiles/glfw.dir/glx_context.c.o -c /build/glfw-latest150107/src/glx_context.c
Linking C shared library cygglfw-3.dll
cd /build/glfw-latest150107/src && /usr/bin/cmake.exe -E cmake_link_script CMakeFiles/glfw.dir/link.txt --verbose=1
/usr/bin/cc -shared -Wl,--enable-auto-import -o cygglfw-3.dll -Wl,--out-implib,libglfw.dll.a -Wl,--major-image-version,3,--minor-image-version,0 CMakeFiles/glfw.dir/clipboard.c.o CMakeFiles/glfw.dir/context.c.o CMakeFiles/glfw.dir/gamma.c.o CMakeFiles/glfw.dir/init.c.o CMakeFiles/glfw.dir/input.c.o CMakeFiles/glfw.dir/joystick.c.o CMakeFiles/glfw.dir/monitor.c.o CMakeFiles/glfw.dir/time.c.o CMakeFiles/glfw.dir/window.c.o CMakeFiles/glfw.dir/x11_clipboard.c.o CMakeFiles/glfw.dir/x11_gamma.c.o CMakeFiles/glfw.dir/x11_init.c.o CMakeFiles/glfw.dir/x11_joystick.c.o CMakeFiles/glfw.dir/x11_monitor.c.o CMakeFiles/glfw.dir/x11_time.c.o CMakeFiles/glfw.dir/x11_window.c.o CMakeFiles/glfw.dir/x11_unicode.c.o CMakeFiles/glfw.dir/glx_context.c.o -lX11 -Wl,-Bstatic -lrt -Wl,-Bdynamic -lXrandr -lXi /usr/local/lib/libXxf86vm.a -Wl,-Bstatic -lrt -lm -Wl,-Bdynamic -lGL -lXrandr -lXi /usr/local/lib/libXxf86vm.a -Wl,-Bstatic -lm -Wl,-Bdynamic -lGL
/usr/local/lib/libXxf86vm.a(XF86VMode.o): In function `find_display':
/build/libXxf86vm-1.1.2/src/XF86VMode.c:75: undefined reference to `XextFindDisplay'
/build/libXxf86vm-1.1.2/src/XF86VMode.c:75:(.text+0x18): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `XextFindDisplay'
/build/libXxf86vm-1.1.2/src/XF86VMode.c:75: undefined reference to `XextCreateExtension'
/build/libXxf86vm-1.1.2/src/XF86VMode.c:75:(.text+0x31): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `XextCreateExtension'
/build/libXxf86vm-1.1.2/src/XF86VMode.c:75: undefined reference to `XextAddDisplay'
/build/libXxf86vm-1.1.2/src/XF86VMode.c:75:(.text+0x7a): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `XextAddDisplay'
/usr/local/lib/libXxf86vm.a(XF86VMode.o): In function `XF86VidModeSetClientVersion':
/build/libXxf86vm-1.1.2/src/XF86VMode.c:139: undefined reference to `_XGetRequest'
/build/libXxf86vm-1.1.2/src/XF86VMode.c:139:(.text+0x11d): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_XGetRequest'
/build/libXxf86vm-1.1.2/src/XF86VMode.c:136: undefined reference to `XMissingExtension'
/build/libXxf86vm-1.1.2/src/XF86VMode.c:136:(.text+0x181): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `XMissingExtension'
/usr/local/lib/libXxf86vm.a(XF86VMode.o): In function `XF86VidModeQueryVersion':
/build/libXxf86vm-1.1.2/src/XF86VMode.c:113: undefined reference to `_XGetRequest'
/build/libXxf86vm-1.1.2/src/XF86VMode.c:113:(.text+0x1da): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_XGetRequest'
/build/libXxf86vm-1.1.2/src/XF86VMode.c:116: undefined reference to `_XReply'
####
# Ommited some lines, you get the basic idea
####
/usr/local/lib/libXxf86vm.a(XF86VMode.o): In function `XF86VidModeGetPermissions':
/build/libXxf86vm-1.1.2/src/XF86VMode.c:1170: undefined reference to `_XGetRequest'
/build/libXxf86vm-1.1.2/src/XF86VMode.c:1174: undefined reference to `_XReply'
/build/libXxf86vm-1.1.2/src/XF86VMode.c:1167: undefined reference to `XMissingExtension'
/usr/local/lib/libXxf86vm.a(XF86VMode.o): In function `close_display':
/build/libXxf86vm-1.1.2/src/XF86VMode.c:80: undefined reference to `XextRemoveDisplay'
collect2: error: ld returned 1 exit status
src/CMakeFiles/glfw.dir/build.make:529: recipe for target 'src/cygglfw-3.dll' failed
make[2]: *** [src/cygglfw-3.dll] Error 1
make[2]: Leaving directory '/build/glfw-latest150107'
CMakeFiles/Makefile2:112: recipe for target 'src/CMakeFiles/glfw.dir/all' failed
make[1]: *** [src/CMakeFiles/glfw.dir/all] Error 2
make[1]: Leaving directory '/build/glfw-latest150107'
Makefile:119: recipe for target 'all' failed
make: *** [all] Error 2
如何修复此问题以便构建共享库?