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

[build] Errors building Android Arch x86_64 #2145

Closed
ColorBuffer opened this issue Nov 17, 2021 · 7 comments
Closed

[build] Errors building Android Arch x86_64 #2145

ColorBuffer opened this issue Nov 17, 2021 · 7 comments
Labels
platform: Android Android platform

Comments

@ColorBuffer
Copy link
Contributor

ColorBuffer commented Nov 17, 2021

Hello,

Version: 4.0 master branch
Platform: Windows
Target: Android
ANDROID_ARCH ?= x86_64

ARM64 works well but:
Im making x86_64 to test an android app on my emulator.

C:\w64devkit\bin\mingw32-make PLATFORM=PLATFORM_ANDROID
using latest w64devkit
caused:

@ColorBuffer
Copy link
Contributor Author

In file included from C:/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/x86_64-w64-mingw32/include/direct.h:10,
from rcore.c:181:
C:/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/x86_64-w64-mingw32/include/io.h:280:15: error: conflicting types for 'mkdir'
int __cdecl mkdir (const char ) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
^~~~~
In file included from rcore.c:169:
C:\Users\Mahdi\AppData\Local\Android\Sdk\ndk\21.4.7075529/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/sys/stat.h:156:5: note: previous declaration of 'mkdir' was here
int mkdir(const char
__path, mode_t __mode);
^~~~~
In file included from C:/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/x86_64-w64-mingw32/include/direct.h:10,
from rcore.c:181:
C:/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/x86_64-w64-mingw32/include/io.h:283:15: error: conflicting types for 'chmod'
int __cdecl chmod (const char , int) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
^~~~~
In file included from rcore.c:169:
C:\Users\Mahdi\AppData\Local\Android\Sdk\ndk\21.4.7075529/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/sys/stat.h:154:5: note: previous declaration of 'chmod' was here
int chmod(const char
__path, mode_t __mode);
^~~~~
In file included from C:/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/x86_64-w64-mingw32/include/direct.h:10,
from rcore.c:181:
C:/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/x86_64-w64-mingw32/include/io.h:326:15: error: conflicting types for 'chmod'
int __cdecl chmod(const char _Filename,int _AccessMode) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
^~~~~
In file included from rcore.c:169:
C:\Users\Mahdi\AppData\Local\Android\Sdk\ndk\21.4.7075529/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/sys/stat.h:154:5: note: previous declaration of 'chmod' was here
int chmod(const char
__path, mode_t __mode);
^~~~~
In file included from C:/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/x86_64-w64-mingw32/include/direct.h:10,
from rcore.c:181:
C:/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/x86_64-w64-mingw32/include/io.h:343:15: error: conflicting types for 'umask'
int __cdecl umask(int _Mode) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
^~~~~
In file included from rcore.c:169:
C:\Users\Mahdi\AppData\Local\Android\Sdk\ndk\21.4.7075529/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/sys/stat.h:168:8: note: previous declaration of 'umask' was here
mode_t umask(mode_t __mask);
^~~~~
In file included from rcore.c:181:
C:/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/x86_64-w64-mingw32/include/direct.h:59:15: error: conflicting types for 'mkdir'
int __cdecl mkdir(const char _Path) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
^~~~~
In file included from rcore.c:169:
C:\Users\Mahdi\AppData\Local\Android\Sdk\ndk\21.4.7075529/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/sys/stat.h:156:5: note: previous declaration of 'mkdir' was here
int mkdir(const char
__path, mode_t __mode);
^~~~~
In file included from C:\Users\Mahdi\AppData\Local\Android\Sdk\ndk\21.4.7075529/sources/android/native_app_glue/android_native_app_glue.h:21,
from rcore.c:227:
C:\Users\Mahdi\AppData\Local\Android\Sdk\ndk\21.4.7075529/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/poll.h:52:35: error: expected ';', ',' or ')' before '__fds'
int poll(struct pollfd* _Nullable __fds, nfds_t __count, int __timeout_ms);
^~~~~
C:\Users\Mahdi\AppData\Local\Android\Sdk\ndk\21.4.7075529/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/poll.h:66:36: error: expected ';', ',' or ')' before '__fds'
int ppoll(struct pollfd* _Nullable __fds, nfds_t __count, const struct timespec* _Nullable __timeout, const sigset_t* _Nullable __mask) __INTRODUCED_IN(21);
^~~~~
In file included from C:\Users\Mahdi\AppData\Local\Android\Sdk\ndk\21.4.7075529/sources/android/native_app_glue/android_native_app_glue.h:21,
from rcore.c:227:
C:\Users\Mahdi\AppData\Local\Android\Sdk\ndk\21.4.7075529/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/poll.h:75:39: error: expected ';', ',' or ')' before '__fds'
int ppoll64(struct pollfd* _Nullable __fds, nfds_t __count, const struct timespec* _Nullable __timeout, const sigset64_t* _Nullable __mask) __INTRODUCED_IN(28);

In file included from C:/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/x86_64-w64-mingw32/include/winbase.h:31,
from C:/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/x86_64-w64-mingw32/include/windows.h:70,
from C:\Users\Mahdi\AppData\Local\Android\Sdk\ndk\21.4.7075529/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/EGL/eglplatform.h:74,
from C:\Users\Mahdi\AppData\Local\Android\Sdk\ndk\21.4.7075529/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/EGL/egl.h:39,
from rcore.c:229:
C:/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/x86_64-w64-mingw32/include/profileapi.h:16:29: error: conflicting types for 'QueryPerformanceCounter'
WINBASEAPI WINBOOL WINAPI QueryPerformanceCounter (LARGE_INTEGER *lpPerformanceCount);
^~~~~~~~~~~~~~~~~~~~~~~
In file included from rcore.c:132:
rgestures.h:159:19: note: previous declaration of 'QueryPerformanceCounter' was here
int __stdcall QueryPerformanceCounter(unsigned long long int *lpPerformanceCount);
^~~~~~~~~~~~~~~~~~~~~~~
In file included from C:/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/x86_64-w64-mingw32/include/winbase.h:31,
from C:/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/x86_64-w64-mingw32/include/windows.h:70,
from C:\Users\Mahdi\AppData\Local\Android\Sdk\ndk\21.4.7075529/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/EGL/eglplatform.h:74,
from C:\Users\Mahdi\AppData\Local\Android\Sdk\ndk\21.4.7075529/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/EGL/egl.h:39,
from rcore.c:229:
C:/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/x86_64-w64-mingw32/include/profileapi.h:17:29: error: conflicting types for 'QueryPerformanceFrequency'
WINBASEAPI WINBOOL WINAPI QueryPerformanceFrequency (LARGE_INTEGER *lpFrequency);
^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from rcore.c:132:
rgestures.h:160:19: note: previous declaration of 'QueryPerformanceFrequency' was here
int __stdcall QueryPerformanceFrequency(unsigned long long int *lpFrequency);
^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/x86_64-w64-mingw32/include/windows.h:71,
from C:\Users\Mahdi\AppData\Local\Android\Sdk\ndk\21.4.7075529/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/EGL/eglplatform.h:74,
from C:\Users\Mahdi\AppData\Local\Android\Sdk\ndk\21.4.7075529/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/EGL/egl.h:39,
from rcore.c:229:
C:/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/x86_64-w64-mingw32/include/wingdi.h:3049:28: error: 'Rectangle' redeclared as different kind of symbol
WINGDIAPI WINBOOL WINAPI Rectangle(HDC hdc,int left,int top,int right,int bottom);
^~~~~~~~~
In file included from rcore.c:115:
raylib.h:233:3: note: previous declaration of 'Rectangle' was here
} Rectangle;
^~~~~~~~~
In file included from C:/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/x86_64-w64-mingw32/include/windows.h:72,
from C:\Users\Mahdi\AppData\Local\Android\Sdk\ndk\21.4.7075529/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/EGL/eglplatform.h:74,
from C:\Users\Mahdi\AppData\Local\Android\Sdk\ndk\21.4.7075529/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/EGL/egl.h:39,
from rcore.c:229:
C:/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/x86_64-w64-mingw32/include/winuser.h:2213:29: error: conflicting types for 'CloseWindow'
WINUSERAPI WINBOOL WINAPI CloseWindow (HWND hWnd);
^~~~~~~~~~~
In file included from rcore.c:115:
raylib.h:907:12: note: previous declaration of 'CloseWindow' was here
RLAPI void CloseWindow(void); // Close window and unload OpenGL context
^~~~~~~~~~~
In file included from C:/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/x86_64-w64-mingw32/include/windows.h:72,
from C:\Users\Mahdi\AppData\Local\Android\Sdk\ndk\21.4.7075529/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/EGL/eglplatform.h:74,
from C:\Users\Mahdi\AppData\Local\Android\Sdk\ndk\21.4.7075529/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/EGL/egl.h:39,
from rcore.c:229:
C:/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/x86_64-w64-mingw32/include/winuser.h:3612:25: error: conflicting types for 'ShowCursor'
WINUSERAPI int WINAPI ShowCursor(WINBOOL bShow);

@ColorBuffer
Copy link
Contributor Author

rcore.c:5300:21: warning: statement with no effect [-Wunused-value]
Rectangle rec = GetFontDefault().recs[95];
^~~~~~~~~
rcore.c:5300:30: error: expected ';' before 'rec'
Rectangle rec = GetFontDefault().recs[95];
^~~~
;
rcore.c:5302:75: error: expected ')' before '{' token
SetShapesTexture(GetFontDefault().texture, (Rectangle){ rec.x + 1, rec.y + 1, rec.width - 2, rec.height - 2 });
^
)
rcore.c:5302:64: error: incompatible type for argument 2 of 'SetShapesTexture'
SetShapesTexture(GetFontDefault().texture, (Rectangle){ rec.x + 1, rec.y + 1, rec.width - 2, rec.height - 2 });

@ColorBuffer ColorBuffer changed the title e Making ARM64 x86_64 causes error Nov 17, 2021
@Peter0x44
Copy link
Contributor

Peter0x44 commented Nov 17, 2021

Hi,
You cannot use w64devkit to create android programs.
You must use the actual android NDK.

This is not an issue with raylib, you are just expecting something to work that won't

See https://github.com/raysan5/raylib/wiki/Working-for-Android for proper instructions to use android

@ColorBuffer
Copy link
Contributor Author

ColorBuffer commented Nov 17, 2021

@Peter0x44
wiki also uses:
mingw32-make PLATFORM=PLATFORM_ANDROID

As I've mentioned there is no problem with ARM64
The actual problem is targeting x86_64 in Makefile.Andriod

@Peter0x44
Copy link
Contributor

Oh, that's my bad
I completely misread the question.

@raysan5
Copy link
Owner

raysan5 commented Nov 17, 2021

@WilledgeR I'm not sure about the issue but it seems it uses a MinGW-w64 x86_64 toolchain (C:/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0) while it should use the x86_64 Android toolchain, as defined in the Makefile.Android:

CC = $(ANDROID_TOOLCHAIN)/bin/x86_64-linux-android$(ANDROID_API_VERSION)-clang
AR = $(ANDROID_TOOLCHAIN)/bin/x86_64-linux-android-ar

@raysan5 raysan5 added the platform: Android Android platform label Nov 17, 2021
@raysan5 raysan5 changed the title Making ARM64 x86_64 causes error [build] Errors building Android Arch x86_64 Nov 17, 2021
@raysan5
Copy link
Owner

raysan5 commented Nov 17, 2021

@WilledgeR I imagine it works now... I'm closing this issue.

@raysan5 raysan5 closed this as completed Nov 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: Android Android platform
Projects
None yet
Development

No branches or pull requests

3 participants