lzhiyong / termux-ndk

android-ndk for termux
Other
506 stars 54 forks source link

Love2d fails to build #64

Closed Vixeliz closed 2 years ago

Vixeliz commented 2 years ago

Hello! This project is amazing! However when building love i get errors:

/data/data/com.termux/files/home/love-android/love/src/jni/love/src/modules/filesystem/physfs/Filesystem.cpp:513:41: warning: 'PHYSFS_getUserDir' is deprecated [-Wdeprecated-declarations]

static std::string userDir = normalize(PHYSFS_getUserDir());                                                                                           ^        
/data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/physfs/physfs.h:792:49: note: 'PHYSFS_getUserDir' has been explicitly marked deprecated here                                                      
PHYSFS_DECL const char *PHYSFS_getUserDir(void) PHYSFS_DEPRECATED;                                                                                              ^       
/data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/physfs/physfs.h:241:42: note: expanded from macro 'PHYSFS_DEPRECATED'                     
#define PHYSFS_DEPRECATED __attribute__((deprecated))                                            ^              
1 warning generated.                                    
/data/data/com.termux/files/home/love-android/love/src/jni/love/src/modules/joystick/sdl/Joystick.cpp:451:23: warning: implicit conversion from 'std::numeric_limits<unsigned int>::type' (aka 'unsigned int') to 'float' changes value from 4294967295 to 4294967296 [-Wimplicit-const-int-float-conversion]                                                   
float maxduration = std::numeric_limits<Uint32>::max() / 1000.0f;                                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~                                        
1 warning generated.                                    
In file included from /data/data/com.termux/files/home/love-android/love/src/jni/love/src/modules/image/magpie/EXRHandler.cpp:32:
/data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/tinyexr/tinyexr.h:7326:15: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage]                             
typedef struct {                                                      ^                                                        
HeaderInfo                               
/data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/tinyexr/tinyexr.h:7349:3: note: type is not C-compatible due to this member declaration     
    void clear() {
                ^~~~~~~~~~~~~~                                        
/data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/tinyexr/tinyexr.h:7378:3:
note: type is given name 'HeaderInfo' for linkage purposes by this typedef declaration
    } HeaderInfo;                                             ^                                                     
/data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/tinyexr/tinyexr.h:10911:50: warning: result of comparison of constant 274877906944 with expression of type 'size_t' (aka 'unsigned int') is always false [-Wtautological-constant-out-of-range-compare]       
if ((total_data_len == 0) || (total_data_len >= 0x4000000000)) {
~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~                                                
2 warnings generated.                                   
In file included from /data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/glslang/glslang/MachineIndependent/InfoSink.cpp:35:
In file included from /data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/glslang/glslang/MachineIndependent/../Include/InfoSink.h:38:
In file included from /data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/glslang/glslang/Include/../Include/Common.h:108:
/data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/glslang/glslang/Include/PoolAlloc.h:307:54:
error: 'operator=' is a private member of 'glslang::TPoolAllocator'                                       
    void setAllocator(TPoolAllocator* a) {
        allocator = *a;
    }   ~~~~~~~~~ ^ ~~                                                       
/data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/glslang/glslang/Include/PoolAlloc.h:244:21:
note:declared private here TPoolAllocator& operator=(const TPoolAllocator&);  // don't allow assignment operator                                           
^                                   
1 error generated.                                      
make: *** [/data/data/com.termux/files/home/android-ndk-r23/build/core/build-binary.mk:478: /data/data/com.termux/files/home/love-android/love/build/intermediates/cxx/Debug/1k26i6se/obj/local/armeabi-v7a/objs-debug/love/src/libraries/glslang/glslang/MachineIndependent/InfoSink.o] Error 1                                                
make: *** Waiting for unfinished jobs....               
In file included from /data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/glslang/glslang/GenericCodeGen/Link.cpp:39:                         
In file included from /data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/glslang/glslang/GenericCodeGen/../Include/Common.h:108:             
/data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/glslang/glslang/Include/PoolAlloc.h:307:54: error: 'operator=' is a private member of 'glslang::TPoolAllocator'                                       
    void setAllocator(TPoolAllocator* a) { 
        allocator = *a; 
    }   ~~~~~~~~~ ^ ~~                                                       
/data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/glslang/glslang/Include/PoolAlloc.h:244:21: note: declared private here                       
TPoolAllocator& operator=(const TPoolAllocator&);  // don't allow assignment operator                                           ^                                   
1 error generated.                                      
make: *** [/data/data/com.termux/files/home/android-ndk-r23/build/core/build-binary.mk:478: /data/data/com.termux/files/home/love-android/love/build/intermediates/cxx/Debug/1k26i6se/obj/local/armeabi-v7a/objs-debug/love/src/libraries/glslang/glslang/GenericCodeGen/Link.o] Error 1                                                        
In file included from /data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/glslang/glslang/GenericCodeGen/CodeGen.cpp:35:
In file included from /data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/glslang/glslang/GenericCodeGen/../Include/Common.h:108:
/data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/glslang/glslang/Include/PoolAlloc.h:307:54:
error: 'operator=' is a private member of 'glslang::TPoolAllocator'                                       
    void setAllocator(TPoolAllocator* a) {
        allocator = *a;
    }   ~~~~~~~~~ ^ ~~                                                       

/data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/glslang/glslang/Include/PoolAlloc.h:244:21:
note:declared private here TPoolAllocator& operator=(const TPoolAllocator&);  // don't allow assignment operator                                           
^                                   
1 error generated.                                      
make: *** [/data/data/com.termux/files/home/android-ndk-r23/build/core/build-binary.mk:478: 
/data/data/com.termux/files/home/love-android/love/build/intermediates/cxx/Debug/1k26i6se/obj/local/armeabi-v7a/objs-debug/love/src/libraries/glslang/glslang/GenericCodeGen/CodeGen.o] Error 1                                                     
In file included from /data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/glslang/glslang/MachineIndependent/Initialize.cpp:53:               
In file included from /data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/glslang/glslang/MachineIndependent/../Include/intermediate.h:55:
In file included from /data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/glslang/glslang/Include/../Include/Common.h:108:
/data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/glslang/glslang/Include/PoolAlloc.h:307:54:
error: 'operator=' is a private member of 'glslang::TPoolAllocator'                                       
    void setAllocator(TPoolAllocator* a) {
        allocator = *a;
    }   ~~~~~~~~~ ^ ~~                                                       

/data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/glslang/glslang/Include/PoolAlloc.h:244:21:
note:declared private here TPoolAllocator& operator=(const TPoolAllocator&);  // don't allow assignment operator                                           
                                    ^                                   
1 error generated.                                      
make: *** [/data/data/com.termux/files/home/android-ndk-r23/build/core/build-binary.mk:478: /data/data/com.termux/files/home/love-android/love/build/intermediates/cxx/Debug/1k26i6se/obj/local/armeabi-v7a/objs-debug/love/src/libraries/glslang/glslang/MachineIndependent/Initialize.o] Error 1                                              
In file included from /data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/glslang/glslang/MachineIndependent/IntermTraverse.cpp:38:           
In file included from /data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/glslang/glslang/MachineIndependent/../Include/intermediate.h:55:    
In file included from /data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/glslang/glslang/Include/../Include/Common.h:108:                    
/data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/glslang/glslang/Include/PoolAlloc.h:307:54: error: 'operator=' is a private member of 'glslang::TPoolAllocator'                                       
    void setAllocator(TPoolAllocator* a) { allocator = *a; }                                                                                               
        ~~~~~~~~~ ^ ~~                                                       
/data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/glslang/glslang/Include/PoolAlloc.h:244:21: note: declared private here                       
TPoolAllocator& operator=(const TPoolAllocator&);  // don't allow assignment operator                                           ^                                   
1 error generated.                                      
make: *** [/data/data/com.termux/files/home/android-ndk-r23/build/core/build-binary.mk:478: /data/data/com.termux/files/home/love-android/love/build/intermediates/cxx/Debug/1k26i6se/obj/local/armeabi-v7a/objs-debug/love/src/libraries/glslang/glslang/MachineIndependent/IntermTraverse.o] Error 1                                          
In file included from /data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/glslang/glslang/MachineIndependent/Intermediate.cpp:43:             
In file included from /data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/glslang/glslang/MachineIndependent/localintermediate.h:42:          
In file included from /data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/glslang/glslang/MachineIndependent/../Include/intermediate.h:55:    
In file included from /data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/glslang/glslang/Include/../Include/Common.h:108:                    
/data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/glslang/glslang/Include/PoolAlloc.h:307:54: error: 'operator=' is a private member of 'glslang::TPoolAllocator'
    void setAllocator(TPoolAllocator* a) {
        allocator = *a;
    }   ~~~~~~~~~ ^ ~~                                                       
/data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/glslang/glslang/Include/PoolAlloc.h:244:21:
note:declared private here TPoolAllocator& operator=(const TPoolAllocator&);  // don't allow assignment operator                                           
                                                   ^
1 error generated.                                      
make:*** [/data/data/com.termux/files/home/android-ndk-r23/build/core/build-binary.mk:478: /data/data/com.termux/files/home/love-android/love/build/intermediates/cxx/Debug/1k26i6se/obj/local/armeabi-v7a/objs-debug/love/src/libraries/glslang/glslang/MachineIndependent/Intermediate.o] Error 1                                            
In file included from /data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/glslang/glslang/MachineIndependent/Constant.cpp:39:
In file included from /data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/glslang/glslang/MachineIndependent/localintermediate.h:42:
In file included from /data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/glslang/glslang/MachineIndependent/../Include/intermediate.h:55:
In file included from /data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/glslang/glslang/Include/../Include/Common.h:108:
/data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/glslang/glslang/Include/PoolAlloc.h:307:54:
error: 'operator='is a private member of 'glslang::TPoolAllocator'                                       
    void setAllocator(TPoolAllocator* a) {
        allocator = *a;
    }   ~~~~~~~~~ ^ ~~            

/data/data/com.termux/files/home/love-android/love/src/jni/love/src/libraries/glslang/glslang/Include/PoolAlloc.h:244:21:
note: declared private here TPoolAllocator& operator=(const TPoolAllocator&);  // don't allow assignment operator                                           ^                                   
1 error generated.                                      
make: *** [/data/data/com.termux/files/home/android-ndk-r23/build/core/build-binary.mk:478: /data/data/com.termux/files/home/love-android/love/build/intermediates/cxx/Debug/1k26i6se/obj/local/armeabi-v7a/objs-debug/love/src/libraries/glslang/glslang/MachineIndependent/Constant.o] Error
* Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org                                                                      
BUILD FAILED in 2m 3s
32 actionable tasks: 6 executed, 26 up-to-date

Any help would be appreciated

lzhiyong commented 2 years ago

error: 'operator=' is a private member of 'glslang::TPoolAllocator'

// use friend class, because copy constructor and assign constructor is private
// in love/src/jni/love/src/libraries/glslang/glslang/Include/PoolAlloc.h

// declare class pool_allocator
template<class T> class pool_allocator;

class TPoolAllocator {
...
protected:
    friend struct tHeader;
    // add friend class 
    template<class T> friend class pool_allocator;
...
}

error: use of undeclared identifier 'assert'

// add the header file in the cpp source files
#include <assert.h>
lzhiyong commented 2 years ago

IMG_20211013_090446

Vixeliz commented 2 years ago

Hmmm so that got it compiling but when trying to install it, it says app failrd to install

Vixeliz commented 2 years ago

Nvm that was the unsigned release debug works great thank you so much! I hope this works after android-11 update for termux