之前还有一个C++的报错是error: ‘offsetof’ was not declared in this scope在CCDrawNode.cpp。现在完全乱套了。
11:41:45 **** Build of configuration Release for project bbbb ****
python D:/test/bbbb/proj.android/build_native.py -b release all
Android NDK: WARNING: APP_PLATFORM android-19 is larger than android:minSdkVersion 9 in ./AndroidManifest.xml
make.exe: Entering directory D:/test/bbbb/proj.android' Compile++ thumb: cocos2dx_internal_static <= CCDrawNode.cpp Compile++ thumb: cocos2dx_internal_static <= CCParticleSystemQuad.cpp Compile++ thumb: cocos2dx_internal_static <= CCTransition.cpp Compile++ thumb: cocos2dx_internal_static <= CCFastTMXLayer.cpp In file included from jni/../../cocos2d/cocos/./2d/CCDrawNode.h:38:0, from jni/../../cocos2d/cocos/./2d/CCDrawNode.cpp:24: D:/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.9/include/cstddef:51:11: error: '::max_align_t' has not been declared using ::max_align_t; ^ In file included from jni/../../cocos2d/cocos/./2d/CCDrawNode.h:38:0, from jni/../../cocos2d/cocos/./2d/CCSprite.h:33, from jni/../../cocos2d/cocos/./2d/CCRenderTexture.h:30, from jni/../../cocos2d/cocos/./2d/CCTransition.cpp:36: D:/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.9/include/cstddef:51:11: error: '::max_align_t' has not been declared using ::max_align_t; ^ In file included from jni/../../cocos2d/cocos/./2d/CCDrawNode.h:38:0, from jni/../../cocos2d/cocos/./2d/CCSprite.h:33, from jni/../../cocos2d/cocos/./2d/CCFastTMXLayer.cpp:39: D:/android-ndk-r10d/sources/cxx-stl/gnu-libstdc++/4.9/include/cstddef:51:11: error: '::max_align_t' has not been declared using ::max_align_t; ^ In file included from D:/android-ndk-r10d/platforms/android-19/arch-arm/usr/include/stdlib.h:37:0, from jni/../../cocos2d/cocos/./platform/android/CCStdC-android.h:38, from jni/../../cocos2d/cocos/./platform/CCStdC.h:36, from jni/../../cocos2d/cocos/./base/ccMacros.h:36, from jni/../../cocos2d/cocos/./2d/CCNode.h:32, from jni/../../cocos2d/cocos/./2d/CCDrawNode.h:34, from jni/../../cocos2d/cocos/./2d/CCDrawNode.cpp:24: jni/../../cocos2d/cocos/./2d/CCDrawNode.cpp: In member function 'virtual bool cocos2d::DrawNode::init()': jni/../../cocos2d/cocos/./2d/CCDrawNode.cpp:223:120: error: '__offsetof__' was not declared in this scope glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, vertices)); ^ jni/../../cocos2d/cocos/./2d/CCDrawNode.cpp: In member function 'void cocos2d::DrawNode::onDraw(const cocos2d::Mat4&, uint32_t)': jni/../../cocos2d/cocos/./2d/CCDrawNode.cpp:350:120: error: '__offsetof__' was not declared in this scope glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, vertices)); ^ jni/../../cocos2d/cocos/./2d/CCDrawNode.cpp: In member function 'void cocos2d::DrawNode::onDrawGLLine(const cocos2d::Mat4&, uint32_t)': jni/../../cocos2d/cocos/./2d/CCDrawNode.cpp:390:120: error: '__offsetof__' was not declared in this scope glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, vertices)); ^ jni/../../cocos2d/cocos/./2d/CCDrawNode.cpp: In member function 'void cocos2d::DrawNode::onDrawGLPoint(const cocos2d::Mat4&, uint32_t)': jni/../../cocos2d/cocos/./2d/CCDrawNode.cpp:432:120: error: '__offsetof__' was not declared in this scope glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, vertices)); ^ At global scope: cc1plus.exe: warning: unrecognized command line option "-Wno-extern-c-compat" cc1plus.exe: warning: unrecognized command line option "-Wno-extern-c-compat" In file included from D:/android-ndk-r10d/platforms/android-19/arch-arm/usr/include/stdlib.h:37:0, from jni/../../cocos2d/cocos/./platform/android/CCStdC-android.h:38, from jni/../../cocos2d/cocos/./platform/CCStdC.h:36, from jni/../../cocos2d/cocos/./base/ccMacros.h:36, from jni/../../cocos2d/cocos/./math/CCGeometry.h:32, from jni/../../cocos2d/cocos/./base/ccTypes.h:33, from jni/../../cocos2d/cocos/./base/CCProtocols.h:32, from jni/../../cocos2d/cocos/./2d/CCParticleSystem.h:30, from jni/../../cocos2d/cocos/./2d/CCParticleSystemQuad.h:31, from jni/../../cocos2d/cocos/./2d/CCParticleSystemQuad.cpp:30: jni/../../cocos2d/cocos/./2d/CCParticleSystemQuad.cpp: In member function 'void cocos2d::ParticleSystemQuad::setupVBOandVAO()': jni/../../cocos2d/cocos/./2d/CCParticleSystemQuad.cpp:476:106: error: '__offsetof__' was not declared in this scope glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, kQuadSize, (GLvoid*) offsetof( V3F_C4B_T2F, vertices)); ^ cc1plus.exe: warning: unrecognized command line option "-Wno-extern-c-compat" cc1plus.exe: warning: unrecognized command line option "-Wno-extern-c-compat" In file included from D:/android-ndk-r10d/platforms/android-19/arch-arm/usr/include/stdlib.h:37:0, from jni/../../cocos2d/cocos/./platform/android/CCStdC-android.h:38, from jni/../../cocos2d/cocos/./platform/CCStdC.h:36, from jni/../../cocos2d/cocos/./base/ccMacros.h:36, from jni/../../cocos2d/cocos/./2d/CCNode.h:32, from jni/../../cocos2d/cocos/./2d/CCFastTMXLayer.h:32, from jni/../../cocos2d/cocos/./2d/CCFastTMXLayer.cpp:37: jni/../../cocos2d/cocos/./2d/CCFastTMXLayer.cpp: In member function 'void cocos2d::experimental::TMXLayer::updateVertexBuffer()': jni/../../cocos2d/cocos/./2d/CCFastTMXLayer.cpp:287:64: error: '__offsetof__' was not declared in this scope _vData->setStream(_vertexBuffer, VertexStreamAttribute(offsetof(V3F_C4B_T2F, colors), GLProgram::VERTEX_ATTRIB_COLOR, GL_UNSIGNED_BYTE, 4, true)); ^ make.exe: *** Error 1 make.exe: *** Waiting for unfinished jobs.... make.exe: *** Error 1 At global scope: cc1plus.exe: warning: unrecognized command line option "-Wno-extern-c-compat" cc1plus.exe: warning: unrecognized command line option "-Wno-extern-c-compat" make.exe: *** Error 1 At global scope: cc1plus.exe: warning: unrecognized command line option "-Wno-extern-c-compat" cc1plus.exe: warning: unrecognized command line option "-Wno-extern-c-compat" make.exe: *** Error 1 make.exe: Leaving directory D:/test/bbbb/proj.android’
We will remove this script next version,you should use cocos console to build android project.
The Selected NDK toolchain version was 4.9 !
Traceback (most recent call last):
File “D:/test/bbbb/proj.android/build_native.py”, line 149, in
build(opts.ndk_build_param,opts.android_platform,opts.build_mode)
File “D:/test/bbbb/proj.android/build_native.py”, line 134, in build
do_build(cocos_root, ndk_root, app_android_root,ndk_build_param,sdk_root,android_platform,build_mode)
File “D:/test/bbbb/proj.android/build_native.py”, line 70, in do_build
raise Exception(“Build dynamic library for project " + app_android_root + " ] fails!”)
Exception: Build dynamic library for project D:\test\bbbb\proj.android ] fails!
11:41:52 Build Finished (took 6s.443ms)
