Android Build Error: 'intptr_t' does not name a type

Problems building or running the engine, queries about how to use features etc.
Post Reply
Whisperd130
Halfling
Posts: 77
Joined: Wed Feb 01, 2017 4:02 pm
x 1

Android Build Error: 'intptr_t' does not name a type

Post by Whisperd130 »

Ogre Version: :1.10:
Operating System: :Windows:
Render System: :EGL:

I want to build arm64-v8a version of Ogre 1.10. I'm using Ndk R16 16.1.4479499, and Cmake version is 3.18.5
This is cmake order I have used.

Code: Select all

cmake -G "NMake Makefiles" -DCMAKE_TOOLCHAIN_FILE=.\cmake\toolchain\android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_NATIVE_API_LEVEL=21 -DANDROID_TOOLCHAIN_NAME=aarch64-linux-android-4.9  -DCMAKE_INSTALL_PREFIX=..\Ogredeps -DCMAKE_BUILD_TYPE=RELEASE ..

After this I used nmake.exe to build libs.
I got error when build libs:

Code: Select all

D:\ogre\Run-Sup\ogre_android_arm_new\build>nmake.exe

Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
Copyright (C) Microsoft Corporation.  All rights reserved.

[  1%] Building CXX object OgreMain/CMakeFiles/OgreMain.dir/src/OgreFileSystem.cpp.o
In file included from D:\ogre\Run-Sup\ogre_android_arm_new\OgreMain\src\OgreFileSystem.cpp:40:0:
D:\ogre\Run-Sup\ogre_android_arm_new\OgreMain\include/OgreSearchOps.h:56:1: error: 'intptr_t' does not name a type
 intptr_t _findfirst(const char *pattern, struct _finddata_t *data);
 ^
D:\ogre\Run-Sup\ogre_android_arm_new\OgreMain\include/OgreSearchOps.h:57:15: error: 'intptr_t' was not declared in this scope
 int _findnext(intptr_t id, struct _finddata_t *data);
               ^
D:\ogre\Run-Sup\ogre_android_arm_new\OgreMain\include/OgreSearchOps.h:57:28: error: expected primary-expression before 'struct'
 int _findnext(intptr_t id, struct _finddata_t *data);
                            ^
D:\ogre\Run-Sup\ogre_android_arm_new\OgreMain\include/OgreSearchOps.h:57:52: error: expression list treated as compound expression in initializer [-fpermissive]
 int _findnext(intptr_t id, struct _finddata_t *data);
                                                    ^
D:\ogre\Run-Sup\ogre_android_arm_new\OgreMain\include/OgreSearchOps.h:58:16: error: 'intptr_t' was not declared in this scope
 int _findclose(intptr_t id);
                ^
D:\ogre\Run-Sup\ogre_android_arm_new\OgreMain\src\OgreFileSystem.cpp: In member function 'void Ogre::FileSystemArchive::findFiles(const String&, bool, bool, Ogre::StringVector*, Ogre::FileInfoList*) const':
D:\ogre\Run-Sup\ogre_android_arm_new\OgreMain\src\OgreFileSystem.cpp:103:9: error: 'intptr_t' was not declared in this scope
         intptr_t lHandle, res;
         ^
D:\ogre\Run-Sup\ogre_android_arm_new\OgreMain\src\OgreFileSystem.cpp:117:9: error: 'lHandle' was not declared in this scope
         lHandle = _findfirst(full_pattern.c_str(), &tagData);
         ^
D:\ogre\Run-Sup\ogre_android_arm_new\OgreMain\src\OgreFileSystem.cpp:117:60: error: '_findfirst' was not declared in this scope
         lHandle = _findfirst(full_pattern.c_str(), &tagData);
                                                            ^
D:\ogre\Run-Sup\ogre_android_arm_new\OgreMain\src\OgreFileSystem.cpp:118:9: error: 'res' was not declared in this scope
         res = 0;
         ^
D:\ogre\Run-Sup\ogre_android_arm_new\OgreMain\src\OgreFileSystem.cpp:141:48: error: '_findnext' cannot be used as a function
             res = _findnext( lHandle, &tagData );
                                                ^
D:\ogre\Run-Sup\ogre_android_arm_new\OgreMain\src\OgreFileSystem.cpp:145:31: error: '_findclose' cannot be used as a function
             _findclose(lHandle);
                               ^
D:\ogre\Run-Sup\ogre_android_arm_new\OgreMain\src\OgreFileSystem.cpp:179:52: error: '_findnext' cannot be used as a function
                 res = _findnext( lHandle, &tagData );
                                                    ^
D:\ogre\Run-Sup\ogre_android_arm_new\OgreMain\src\OgreFileSystem.cpp:183:35: error: '_findclose' cannot be used as a function
                 _findclose(lHandle);
                                   ^
NMAKE : fatal error U1077: 'D:\Android\Sdk\ndk\16.1.4479499\toolchains\aarch64-linux-android-4.9\prebuilt\windows-x86_64\bin\aarch64-linux-android-g++.exe' : return code '0x1'
Stop.
NMAKE : fatal error U1077: 'D:\ogre\Run-Sup\ogre_android_arm_new\build\nmake.exe' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'D:\ogre\Run-Sup\ogre_android_arm_new\build\nmake.exe' : return code '0x2'
Stop.

I'm not sure what happened of it. It seems like the stdint.h does not load in right way.
My ogredeps version is :

Code: Select all

INCLUDED LIBRARY VERSIONS


* Cg 3.1 (Windows only)
* FreeImage 3.15.3
* freetype 2.4.9
* OIS 1.4
* SDL2 2.0.4
* zlib 1.2.8
* zziplib 0.13.62

CUSTOM OGRE CHANGES
* /src/zlib/gzguts.h (lines 32-34):
  Added "unistd.h" include on non-Windows platforms for Ogre's Emscripten support.
* /src/FreeImage/Source/FreeImage/PluginTIFF.cpp:
  Fixed loss of precision typecast to support MinGW 64-bit builds.
* /src/zziplib/zzip/conf.h:
  Fix incorrect usage of _MSC_VER to allow MinGW compilation.

Is anyone could help?

Whisperd130
Halfling
Posts: 77
Joined: Wed Feb 01, 2017 4:02 pm
x 1

Re: Android Build Error: 'intptr_t' does not name a type

Post by Whisperd130 »

After searching the head files about 'intptr_t', I found that stdint-gcc.h have all I want.

I have just add #include <stdint-gcc.h> to all the file which said lost '::int8_t' or 'uint8_t' .

Building finish, but not sure what happened actually.

Post Reply