Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cocos2d-x failed to build on Windows due to fatal error C1083: Cannot open include file: 'bullet/LinearMath/btIDebugDraw.h': No such file or directory #17966

Closed
KarenHuang2016 opened this issue Jun 22, 2017 · 2 comments

Comments

@KarenHuang2016
Copy link

KarenHuang2016 commented Jun 22, 2017

Environment:
Windows Server 2012 R2 + VS2015 Update 3 + cocos2d-x v3 branch latest srouce code

We tried to build cocos2d-x on Windows. It failed due to fatal error C1083: Cannot open include file: 'bullet/LinearMath/btIDebugDraw.h': No such file or directory. This issue is caused by v3 branch revision 4ce443b . It seems the cl command lacks the include path for btIDebugDraw.h. Could you please take a look at this? Thanks in advance!

Steps to Reproduce:

  1. git clone --recursive https://github.com/cocos2d/cocos2d-x.git D:\Cocos2dx\src
  2. Open a VS 2015 x86 command prompt and browse to D:\Cocos2dx\src
  3. python download-deps.py -r None
  4. cmake -G "Visual Studio 14" -DCMAKE_SYSTEM_VERSION=10.0.14393.0 ..\src
  5. msbuild /m /p:Configuration=Release;Platform=Win32 build_x86\Cocos2d-X.sln /t:Rebuild

Actual result:
The full log file is attached.
cocos2dx_x86_build.txt

   "D:\Cocos2dx\build_x86\Cocos2d-X.sln" (Rebuild target) (1) ->
   "D:\Cocos2dx\build_x86\cocos\cocos2d.vcxproj.metaproj" (Rebuild target) (3) ->
   "D:\Cocos2dx\build_x86\cocos\cocos2dInternal.vcxproj.metaproj" (Rebuild target) (4) ->
   "D:\Cocos2dx\build_x86\cocos\cocos2dInternal.vcxproj" (Rebuild target) (15) ->
   (ClCompile target) -> 
     D:\Cocos2dx\src\cocos\physics3d/CCPhysics3DDebugDrawer.h(37): fatal error C1083: Cannot open include file: 'bullet/LinearMath/btIDebugDraw.h': No such file or directory (s:\dd\feature\winc\src\vctools\compiler\cxxfe\sl\p1\c\p0prepro.c:1654) [D:\Cocos2dx\build_x86\cocos\cocos2dInternal.vcxproj]
     D:\Cocos2dx\src\cocos\physics3d/CCPhysics3DDebugDrawer.h(37): fatal error C1083: Cannot open include file: 'bullet/LinearMath/btIDebugDraw.h': No such file or directory (s:\dd\feature\winc\src\vctools\compiler\cxxfe\sl\p1\c\p0prepro.c:1654) [D:\Cocos2dx\build_x86\cocos\cocos2dInternal.vcxproj]
     D:\Cocos2dx\src\cocos\physics3d/CCPhysics3DDebugDrawer.h(37): fatal error C1083: Cannot open include file: 'bullet/LinearMath/btIDebugDraw.h': No such file or directory (s:\dd\feature\winc\src\vctools\compiler\cxxfe\sl\p1\c\p0prepro.c:1654) [D:\Cocos2dx\build_x86\cocos\cocos2dInternal.vcxproj]
     D:\Cocos2dx\src\cocos\physics3d/CCPhysics3DDebugDrawer.h(37): fatal error C1083: Cannot open include file: 'bullet/LinearMath/btIDebugDraw.h': No such file or directory (s:\dd\feature\winc\src\vctools\compiler\cxxfe\sl\p1\c\p0prepro.c:1654) [D:\Cocos2dx\build_x86\cocos\cocos2dInternal.vcxproj]
     D:\Cocos2dx\src\cocos\physics3d/CCPhysics3DDebugDrawer.h(37): fatal error C1083: Cannot open include file: 'bullet/LinearMath/btIDebugDraw.h': No such file or directory (s:\dd\feature\winc\src\vctools\compiler\cxxfe\sl\p1\c\p0prepro.c:1654) [D:\Cocos2dx\build_x86\cocos\cocos2dInternal.vcxproj]
     D:\Cocos2dx\src\cocos\physics3d/CCPhysics3DDebugDrawer.h(37): fatal error C1083: Cannot open include file: 'bullet/LinearMath/btIDebugDraw.h': No such file or directory (s:\dd\feature\winc\src\vctools\compiler\cxxfe\sl\p1\c\p0prepro.c:1654) [D:\Cocos2dx\build_x86\cocos\cocos2dInternal.vcxproj]
     D:\Cocos2dx\src\cocos\physics3d/CCPhysics3DDebugDrawer.h(37): fatal error C1083: Cannot open include file: 'bullet/LinearMath/btIDebugDraw.h': No such file or directory (s:\dd\feature\winc\src\vctools\compiler\cxxfe\sl\p1\c\p0prepro.c:1654) [D:\Cocos2dx\build_x86\cocos\cocos2dInternal.vcxproj]
     D:\Cocos2dx\src\cocos\physics3d/CCPhysics3DDebugDrawer.h(37): fatal error C1083: Cannot open include file: 'bullet/LinearMath/btIDebugDraw.h': No such file or directory (s:\dd\feature\winc\src\vctools\compiler\cxxfe\sl\p1\c\p0prepro.c:1654) [D:\Cocos2dx\build_x86\cocos\cocos2dInternal.vcxproj]
@glennerichall
Copy link

glennerichall commented Jan 6, 2018

I changed the CocosUsePrebuiltLibs.cmake file this way at

set(_bullet_libs BulletDynamics libBulletDynamics BulletCollision libBulletCollision BulletMultiThreaded libBulletMultiThreaded LinearMath libLinearMath MiniCL libMiniCL)

if(WINDOWS)
  if (${MSVC_VERSION} EQUAL 1900 OR ${MSVC_VERSION} GREATER 1900)
    set(_bullet_libs bullet libbullet-2015)
 else()
   set(_bullet_libs bullet libbullet)
 endif(${MSVC_VERSION})
else()
  # sequence is important
  set(_bullet_libs BulletDynamics libBulletDynamics BulletCollision libBulletCollision BulletMultiThreaded libBulletMultiThreaded LinearMath libLinearMath MiniCL libMiniCL)
endif(WINDOWS)

Change the line

${_root}/prebuilt/${PLATFORM_FOLDER}/release-lib

to ${_root}/prebuilt/${PLATFORM_FOLDER}/${CMAKE_BUILD_TYPE}-lib

And also changed folder names in external/bullet/prebuilt/win32/debug and release to debug-lib and release-lib

@drelaptop
Copy link
Contributor

Now the cmake have support Windows MSVC compiler, you can have a try using GitHub latest code(4675ee7 and later)

please close this issue @minggo

@minggo minggo closed this as completed May 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants