C:\fpc\bin\i386-win32\arm-linux-ld.exe: warning: E:\Sources\lazarus-fpc\android-ndk\examples\opengltest\android\libs\armeabi\link.res contains output sections; did you forget -T?E:\Sources\lazarus-fpc\android-ndk\examples\opengltest\lib\arm-linux\ndkopengltest.o: In function `FPC_SHARED_LIB_START':ndkopengltest.pas:(.text.n_p$ndkopengltest_$$_fpc_shared_lib_start+0x0): multiple definition of `FPC_SHARED_LIB_START'C:\fpc\units\arm-linux\rtl\dllprt0.o:dllprt0.as:(.text+0x0): first defined herendkopengltest.pas(255,37) Error: Error while linking
For this one, I have no idea...
procedure PASCALMAIN; external name 'PASCALMAIN';procedure FPC_SHARED_LIB_START; [public, alias: 'FPC_SHARED_LIB_START'];begin PASCALMAIN;end;
felipemdc, the problem with FPC_SHARED_LIB_START has been fixed in svn trunk, so it should be removed from the example
E/AndroidRuntime(15688): FATAL EXCEPTION: mainE/AndroidRuntime(15688): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.pascal.opengltest/android.app.NativeActivity}: java.lang.IllegalArgumentException: Unable to load native library: /data/data/com.pascal.opengltest/lib/libmain.so
OK, compiled. But got exception when running:E/AndroidRuntime(15688): FATAL EXCEPTION: mainE/AndroidRuntime(15688): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.pascal.opengltest/android.app.NativeActivity}: java.lang.IllegalArgumentException: Unable to load native library: /data/data/com.pascal.opengltest/lib/libmain.so
I have android-10 for the SDK and android-9 for the NDK (I have no idea why the NDK skips version 10, it jumps over to 14).
Another person had exactly the same error, and he was also trying to do it from Windows.I had no problem in Linux.
Did you configure the binutils for eabi=5?
program arm_linux_as;uses SysUtils;var Params: array of AnsiString; i: Word;begin SetLength(Params,ParamCount + 1); Params[0] := '-meabi=5'; for i := 1 to ParamCount do Params[i] := ParamStr(i); ExecuteProcess(IncludeTrailingPathDelimiter(ExtractFilePath(ParamStr(0))) + 'arm-linux-as.orig.exe',Params);end.
Did you compile your cross-compiler with software floating point?
Thank you so much! This is very cool!But I noticed that you download the OpenGL statically. How do I compile android app loading OpenGL dynamically via dynlibs, that is, through LoadLibrary and GetProcedureAddress?
I use FPC 2.7.1 and your demo has not tried to run me just interested in the source code
How do I compile android app loading OpenGL dynamically via dynlibs, that is, through LoadLibrary and GetProcedureAddress?