CMake 无法静态链接 SDL2

2024-03-30

我正在尝试使用 CMake 和 MSYS Makefile 构建一个简单的 SDL2 游戏。

我想静态链接 SDL2,这样我就可以分发单个可执行文件,而不必包含 SDL2.dll。

这是我的CMakeLists.txt file:

project(racer-sdl)

cmake_minimum_required(VERSION 2.8)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_EXE_LINKER_FLAGS "-static")

include(FindPkgConfig)
pkg_search_module(SDL2 sdl2)
if (SDL2_FOUND)
  message(STATUS "Using SDL2")
  add_definitions(-DUSE_SDL2)
  include_directories(${SDL2_INCLUDE_DIRS})
  link_directories(${SDL2_LIBRARY_DIRS})
  link_libraries(${SDL2_LIBRARIES})
else ()
  message(FATAL_ERROR "Missing SDL2")
endif ()

file(GLOB SOURCE_FILES src/*.cpp src/*.hpp)
add_executable(${PROJECT_NAME} ${SOURCE_FILES})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${SDL2_LIBRARIES})

我可以在没有-static链接器标志,但有了它我得到了一长串未定义的引用。

c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_systimer.o): In function `timeSetPeriod':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/timer/windows/SDL_systimer.c:58: undefined reference to `_imp__timeBeginPeriod@4'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/timer/windows/SDL_systimer.c:52: undefined reference to `_imp__timeEndPeriod@4'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/timer/windows/SDL_systimer.c:58: undefined reference to `_imp__timeBeginPeriod@4'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_systimer.o): In function `SDL_TicksInit':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/timer/windows/SDL_systimer.c:106: undefined reference to `_imp__timeGetTime@0'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_systimer.o): In function `timeSetPeriod':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/timer/windows/SDL_systimer.c:52: undefined reference to `_imp__timeEndPeriod@4'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/timer/windows/SDL_systimer.c:52: undefined reference to `_imp__timeEndPeriod@4'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_systimer.o): In function `SDL_GetTicks_REAL':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/timer/windows/SDL_systimer.c:159: undefined reference to `_imp__timeGetTime@0'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_systimer.o): In function `timeSetPeriod':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/timer/windows/SDL_systimer.c:58: undefined reference to `_imp__timeBeginPeriod@4'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_systimer.o): In function `SDL_TicksInit':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/timer/windows/SDL_systimer.c:106: undefined reference to `_imp__timeGetTime@0'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_systimer.o): In function `timeSetPeriod':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/timer/windows/SDL_systimer.c:52: undefined reference to `_imp__timeEndPeriod@4'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_systimer.o): In function `SDL_GetTicks_REAL':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/timer/windows/SDL_systimer.c:159: undefined reference to `_imp__timeGetTime@0'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_systimer.o): In function `timeSetPeriod':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/timer/windows/SDL_systimer.c:58: undefined reference to `_imp__timeBeginPeriod@4'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_systimer.o): In function `SDL_TicksInit':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/timer/windows/SDL_systimer.c:106: undefined reference to `_imp__timeGetTime@0'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_systimer.o): In function `timeSetPeriod':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/timer/windows/SDL_systimer.c:52: undefined reference to `_imp__timeEndPeriod@4'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_SetupAPI':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:596: undefined reference to `ImmGetIMEFileNameA@12'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:609: undefined reference to `ImmGetContext@4'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:612: undefined reference to `ImmReleaseContext@8'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_GetId':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:530: undefined reference to `ImmGetIMEFileNameA@12'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:545: undefined reference to `GetFileVersionInfoSizeA@8'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:549: undefined reference to `GetFileVersionInfoA@16'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:550: undefined reference to `VerQueryValueA@16'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_ClearComposition':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:662: undefined reference to `ImmGetContext@4'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:666: undefined reference to `ImmNotifyIME@16'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:670: undefined reference to `ImmNotifyIME@16'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:671: undefined reference to `ImmReleaseContext@8'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_Disable':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:344: undefined reference to `ImmAssociateContext@8'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_ClearComposition':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:668: undefined reference to `ImmSetCompositionStringW@24'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:662: undefined reference to `ImmGetContext@4'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:666: undefined reference to `ImmNotifyIME@16'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:670: undefined reference to `ImmNotifyIME@16'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:671: undefined reference to `ImmReleaseContext@8'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:668: undefined reference to `ImmSetCompositionStringW@24'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_Init':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:303: undefined reference to `ImmGetContext@4'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:304: undefined reference to `ImmReleaseContext@8'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_GetId':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:530: undefined reference to `ImmGetIMEFileNameA@12'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:545: undefined reference to `GetFileVersionInfoSizeA@8'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:549: undefined reference to `GetFileVersionInfoA@16'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_GetReadingString':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:402: undefined reference to `ImmGetContext@4'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:477: undefined reference to `ImmReleaseContext@8'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_GetId':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:550: undefined reference to `VerQueryValueA@16'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_Quit':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:358: undefined reference to `ImmAssociateContext@8'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_Enable':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:329: undefined reference to `ImmAssociateContext@8'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_ClearComposition':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:662: undefined reference to `ImmGetContext@4'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:666: undefined reference to `ImmNotifyIME@16'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:670: undefined reference to `ImmNotifyIME@16'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:671: undefined reference to `ImmReleaseContext@8'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_Disable':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:344: undefined reference to `ImmAssociateContext@8'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:668: undefined reference to `ImmSetCompositionStringW@24'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_HandleMessage':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:834: undefined reference to `ImmGetContext@4'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_GetCompositionString':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:678: undefined reference to `ImmGetCompositionStringW@16'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:683: undefined reference to `ImmGetCompositionStringW@16'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_HandleMessage':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:872: undefined reference to `ImmReleaseContext@8'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_ClearComposition':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:662: undefined reference to `ImmGetContext@4'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:666: undefined reference to `ImmNotifyIME@16'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:670: undefined reference to `ImmNotifyIME@16'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:671: undefined reference to `ImmReleaseContext@8'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_HandleMessage':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:867: undefined reference to `ImmGetContext@4'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_GetCandidateList':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:746: undefined reference to `ImmGetCandidateListW@16'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_GetCompositionString':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:678: undefined reference to `ImmGetCompositionStringW@16'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:683: undefined reference to `ImmGetCompositionStringW@16'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_InputLangChanged':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:668: undefined reference to `ImmSetCompositionStringW@24'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_windowskeyboard.o): In function `IME_GetCandidateList':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:750: undefined reference to `ImmGetCandidateListW@16'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_winmm.o): In function `WINMM_CloseDevice':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/audio/winmm/SDL_winmm.c:172: undefined reference to `_imp__waveOutUnprepareHeader@12'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/audio/winmm/SDL_winmm.c:172: undefined reference to `_imp__waveOutUnprepareHeader@12'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/audio/winmm/SDL_winmm.c:184: undefined reference to `_imp__waveInClose@4'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/audio/winmm/SDL_winmm.c:189: undefined reference to `_imp__waveOutClose@4'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_winmm.o): In function `WINMM_PlayDevice':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/audio/winmm/SDL_winmm.c:133: undefined reference to `_imp__waveOutWrite@12'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_winmm.o): In function `DetectWaveOutDevs':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/audio/winmm/SDL_winmm.c:55: undefined reference to `_imp__waveOutGetNumDevs@0'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/audio/winmm/SDL_winmm.c:55: undefined reference to `_imp__waveOutGetDevCapsW@12'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_winmm.o): In function `DetectWaveInDevs':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/audio/winmm/SDL_winmm.c:56: undefined reference to `_imp__waveInGetNumDevs@0'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/audio/winmm/SDL_winmm.c:56: undefined reference to `_imp__waveInGetDevCapsW@12'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_winmm.o): In function `WINMM_OpenDevice':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/audio/winmm/SDL_winmm.c:235: undefined reference to `_imp__waveInGetNumDevs@0'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/audio/winmm/SDL_winmm.c:238: undefined reference to `_imp__waveInGetDevCapsW@12'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/audio/winmm/SDL_winmm.c:316: undefined reference to `_imp__waveInOpen@24'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/audio/winmm/SDL_winmm.c:366: undefined reference to `_imp__waveOutPrepareHeader@12'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/audio/winmm/SDL_winmm.c:248: undefined reference to `_imp__waveOutGetNumDevs@0'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/audio/winmm/SDL_winmm.c:251: undefined reference to `_imp__waveOutGetDevCapsW@12'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_winmm.o): In function `PrepWaveFormat':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/audio/winmm/SDL_winmm.c:218: undefined reference to `_imp__waveOutOpen@24'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/audio/winmm/SDL_winmm.c:216: undefined reference to `_imp__waveInOpen@24'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_winmm.o): In function `WINMM_OpenDevice':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/audio/winmm/SDL_winmm.c:320: undefined reference to `_imp__waveOutOpen@24'
c:/SDL2-2.0.3/i686-w64-mingw32/lib\libSDL2.a(SDL_winmm.o): In function `SetMMerror':
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/audio/winmm/SDL_winmm.c:108: undefined reference to `_imp__waveOutGetErrorTextW@12'
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/audio/winmm/SDL_winmm.c:108: undefined reference to `_imp__waveOutGetErrorTextW@12'
collect2.exe: error: ld returned 1 exit status
make[2]: *** [racer-sdl.exe] Error 1
make[1]: *** [CMakeFiles/racer-sdl.dir/all] Error 2
make: *** [all] Error 2

答案在这里给出:SDL 1.3/2.0 设置 https://stackoverflow.com/questions/14318447/sdl-1-3-2-0-setting-up

必须链接到这些库:

-lmingw32 -lSDL2main -lSDL2 -lm -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion -luuid
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

CMake 无法静态链接 SDL2 的相关文章

随机推荐

  • 如何使用简单注入器将依赖项注入到 WCF 属性中

    我有一堆与 REST 和 SOAP 配合使用的 WCF 服务 我创建了一个 WCF 属性 用于检查当前 httpcontext 是否存在 如果存在 则使用 cookie 身份验证 否则使用自定义 WCF 身份验证 我的属性如下所示 Publ
  • Android 颜色通知图标

    我正在开发一个为用户创建通知的应用程序 我希望图标在状态栏中显示为白色 但在下拉通知菜单中显示时显示为蓝色 以下是 Google Store 应用执行相同操作的示例 状态栏中的白色通知 下拉菜单中的彩色通知 我怎样才能复制这个 我必须设置哪
  • pjax :HTML 链接,其工作方式类似于浏览器后退按钮

    我使用 pjax 进行网站导航 我需要创建一个 HTML 后退按钮 其工作方式与浏览器后退按钮完全相同 但这应该是一个简单的 HTML 链接 如何创建导航到上一页的 pjax 链接 我搜索过 所有主题似乎都与浏览器后退按钮有关 这不是我想要
  • Apache Web 服务器在 60 秒后超时

    我在 IBM Softlayer 中运行的 apache Web 服务器 php 在 60 秒后遇到超时 这些是我的设置 这些设置后httpd服务器重新启动 httpd conf TimeOut 300 Timeout 300 同时尝试两者
  • 颤振行和列

    我是一个颤振初学者 如何创建无边框的 4 2 表格列之类的元素 我尝试过 但没有得到我想要的对齐方式 像这样 https i stack imgur com i1a3f jpg 有人可以指导我如何解决这个问题吗 这是我的有状态小部件的构建方
  • 如何改进 clisp 错误消息?

    我已经接触过一些clisp 有点令人困惑的是它没有打印出错误所在的行号 或者 至少给出错误所在的一般提示 在某些情况下这一定是可能的 对吧 有什么方法可以获得更好的错误消息吗 正如我看到的大多数涉及 clisp 的问题一样 答案可能是 不要
  • 请对我的示例 Python 程序进行代码审查 [关闭]

    这个问题不太可能对任何未来的访客有帮助 它只与一个较小的地理区域 一个特定的时间点或一个非常狭窄的情况相关 通常不适用于全世界的互联网受众 为了帮助使这个问题更广泛地适用 访问帮助中心 help reopen questions 我仍在学习
  • 在 javascript 排序调用之前强制更新 element.innerHTML

    这种情况的最佳实践是什么 1 用户点击 对巨大的javascript数组进行排序 2 浏览器通过element innerHTML Sorting 显示 Sorting 3 浏览器对巨大的 javascript 数组进行排序 100 CPU
  • 使用流畅语法的嵌套 GroupBy LINQ

    我正在尝试使用流畅的 即 方法 语法编写嵌套的 GroupBy LINQ 表达式 这是我的课程和数据 class Person public String ZipCode Gender Name private static List
  • NotImplementedError:无法对未注册的加载器类型执行此操作

    我正在编写一个小脚本来生成 HTML 文件 为此 我正在使用jinja2 这是我的脚本 在jinja2文档 coding utf 8 from jinja2 import Environment PackageLoader env Envi
  • Nuget 包有什么意义?

    也许我在这里做错了什么或者表达了纯粹的无知 但我真的看不出 Nuget 包有什么好处 我最近决定安装一些 Nuget 包来替换我的应用程序中的静态 DLL 当我检查包创建的文件夹时 它们似乎包含许多不同版本的 DLL 所有这些都嵌套在一系列
  • 重命名没有列名的 pandas 数据框的列[重复]

    这个问题在这里已经有答案了 我试图在 dataframe from dict 操作之后命名新数据帧的列 只需使用 pandas dataframe from dict 函数 df pd DataFrame from dict my dict
  • 如何在python2.7中安装gtk?

    我正在使用 Debian 6 04 和 Python 2 7我编译了Python 2 7 configure make make install 在控制台中 gt python2 7 Python 2 7 3 default Jul 28
  • 如何排序 unsort: array(1).sort 转换 array(2) -> array(3).unsort (反转 array(1).sort

    如何对结果进行排序 操作和取消排序 假设我有一个浮点数组p1 0 15 0 3 0 25 0 12 其排序为 p2 sort p1 一个函数 操作p2作为输入 导致p3 p3 f p2 x y 对于某些功能f 我怎样才能取消排序p3以最聪明
  • Jmeter中的“延迟时间”与“连接时间”有什么区别?

    我是jmeter 3 1用户 我不清楚 延迟时间 与 连接时间 的区别 事实上 在jmeter官方文档中 是这样说的 新的连接时间指标 connectTime 表示建立连接的时间 默认情况下 它不会保存到 CSV 或 XML 要保存它 请添
  • 为什么当我导入正在打印的同一文件时,Python 会打印两次输出?

    我一直在玩Python 因为我是Python的初学者 我写了以下 Parent 课程 这是我从 Udacity 在线课程中阅读的 继承 py 文件 import inheritance Why this import statement c
  • 我怎样才能使其成为类的私有成员或方法,以便可以在静态库本身内部而不是在库外部访问它?

    我想为 Objective C 中的以下类准备小型静态库 A类 B类 C类 我想将这些类包含在静态库中 现在 A 类可以访问 B 类或 C 类方法的公共成员 现在当我将上述库集成到其他项目中时 我准备了D类 只能访问A类和B类 不是 C 类
  • Python 从网站上抓取表格?

    我想了解 treasury gov 网站上提供的所有国债收益率 https www treasury gov resource center data chart center interest rates Pages TextView a
  • 临时表上的聚集索引

    我正在尝试优化一个具有如下代码的过程 CREATE TABLE t1 c1 int c2 varchar 20 c3 varchar 50 CREATE CLUSTERED INDEX ix t1 ON t1 c3 ON PRIMARY 我
  • CMake 无法静态链接 SDL2

    我正在尝试使用 CMake 和 MSYS Makefile 构建一个简单的 SDL2 游戏 我想静态链接 SDL2 这样我就可以分发单个可执行文件 而不必包含 SDL2 dll 这是我的CMakeLists txt file project