这个问题只有在win32平台下才有
- frameworks\cocos2d-x\cmake\Modules\CocosUsePrebuiltLibs.cmake
# prebuild模块 set(all_prebuilt_libs chipmunk curl freetype2 jpeg png tiff webp websockets openssl bullet ) # 查找的目录 set(lib_dir_candidates ${_root}/prebuilt/${PLATFORM_FOLDER}/${ANDROID_ABI} ${_root}/prebuilt/${PLATFORM_FOLDER}/${ARCH_DIR} ${_root}/prebuilt/${PLATFORM_FOLDER} # 注意这里的release-lib, 其实只有chipmunk有 ${_root}/prebuilt/${PLATFORM_FOLDER}/release-lib ${_root}/prebuilt/${ARCH_DIR} ${_root}/libraries/${PLATFORM_FOLDER} ${_root}/prebuilt ) # 中间的逻辑是收集所有的lib路径 # 如果找到了设置对应的变量${_prefix}_LIBRARIES if(libs) set(${_prefix}_LIBRARIES ${libs} CACHE STRING "Libraries to link for ${_prefix}" FORCE) endif() 复制代码
- chipmunk:cocos2d-x\external\chipmunk\prebuilt\win10\win32\chipmunk.lib
- chipmunk:cocos2d-x\external\chipmunk\prebuilt\win32\release-lib\chipmunk.lib
网络异常,图片无法展示|
- curl: cocos2d-x\external\curl\prebuilt\win32\libcurl.lib
- freetype2: cocos2d-x\external\freetype2\prebuilt\win32\freetype.lib
- jpeg: cocos2d-x\external\jpeg\prebuilt\win32\libjpeg.lib
- png: cocos2d-x\external\png\prebuilt\win32\libpng.lib
- tiff: cocos2d-x\external\tiff\prebuilt\win32\libtiff.lib
- webp: cocos2d-x\external\webp\prebuilt\win32\libwebp.lib
- websockets: cocos2d-x\external\websockets\prebuilt\win32\websockets.lib
- openssl: cocos2d-x\external\openssl\prebuilt\win32\libssl.lib
- bullet: cocos2d-x\external\bullet\prebuilt\win32\debug\libbullet.lib
问题就出在bullet的debug目录
网络异常,图片无法展示
|
查找目录的确是没有相关的目录的,很不幸在官方仓库也是这么组织目录的
一个很细的逻辑:
里面有一段这样的逻辑,其实我发现没有任何用,_bullet_libs
的设置是无效的,不太清楚为啥这么写
# sequence is important set(_bullet_libs BulletDynamics libBulletDynamics BulletCollision libBulletCollision BulletMultiThreaded libBulletMultiThreaded LinearMath libLinearMath MiniCL libMiniCL) 复制代码
临时解决办法
增加lib_dir_candidates
的目录,显然,没有考虑到debug、release模式,但是chipmunk
也存在这个问题
${_root}/prebuilt/${PLATFORM_FOLDER}/release 复制代码
特殊情况:zlib
有2个查找路径,zlib是在specific里面
set(roots ${COCOS_EXTERNAL_DIR}/${_lib} ${COCOS_EXTERNAL_DIR}/${PLATFORM_FOLDER}-specific/${_lib} ) 复制代码
网络异常,图片无法展示
|
网络异常,图片无法展示
|