coronalabs / corona

Solar2D Game Engine main repository (ex Corona SDK)
https://solar2d.com/
MIT License
2.54k stars 273 forks source link

plugin.zip seems to be broken on certain linux machines #728

Open consler opened 2 months ago

consler commented 2 months ago

When trying to run and project with plugin.zip in build.settings and required: path/to/my/project/main.lua:1: error loading module ‘plugin.zip’ from file ‘/home/consler/snap/solar2d/x2/.Solar2D/Plugins/plugin.zip.so’: /home/consler/snap/solar2d/x2/. Solar2D/Plugins/plugin.zip. so: undefined symbol: ZN6Corona14AsyncTask QueueC1Ev

I use Arch Linux, ldd showed that there isn't a shared library that's missing.

I tried to rebuild the plugin, here are my steps: git clone https://github.com/coronalabs/com.coronalabs-plugin.zip.git cd com.coronalabs-plugin.zip/src/linux make and the output is

make -f  "zip.mk"
make[1]: Entering directory '/home/consler/com.coronalabs-plugin.zip/src/linux'
/usr/bin/g++  -c  "../shared/AsyncZip.cpp" -O2 -Wall -fPIC -DNDEBUG  -o ./Release/up_shared_AsyncZip.cpp.o -I. -I. -I../shared -I../shared/CoronaEnterprise/shared/include -I../shared/minizip 
../shared/AsyncZip.cpp: In member function ‘void Corona::AsyncZip::Finalize(lua_State*)’:
../shared/AsyncZip.cpp:44:35: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::queue<Corona::ZipTask*>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
   44 |                 for (int i = 0; i < fFinishedTasks.size(); i++)
      |                                 ~~^~~~~~~~~~~~~~~~~~~~~~~
../shared/AsyncZip.cpp: In member function ‘virtual void Corona::AsyncZip::Compress(lua_State*)’:
../shared/AsyncZip.cpp:316:43: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<std::__cxx11::basic_string<char> >::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
  316 |                         for (int i = 0; i < keys.size(); i++)
      |                                         ~~^~~~~~~~~~~~~
In file included from ../shared/AsyncZip.h:16,
                 from ../shared/AsyncZip.cpp:9:
../shared/AsyncTask.h: At global scope:
../shared/AsyncTask.h:71:22: warning: ‘void* Corona::AsyncTaskQueue_function(void*)’ defined but not used [-Wunused-function]
   71 |         static void *AsyncTaskQueue_function(void *taskQueue)
      |                      ^~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/g++  -c  "../shared/ZipLibrary.cpp" -O2 -Wall -fPIC -DNDEBUG  -o ./Release/up_shared_ZipLibrary.cpp.o -I. -I. -I../shared -I../shared/CoronaEnterprise/shared/include -I../shared/minizip 
In file included from ../shared/AsyncZip.h:16,
                 from ../shared/ZipLibrary.cpp:9:
../shared/AsyncTask.h:71:22: warning: ‘void* Corona::AsyncTaskQueue_function(void*)’ defined but not used [-Wunused-function]
   71 |         static void *AsyncTaskQueue_function(void *taskQueue)
      |                      ^~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/g++  -c  "../shared/ZipTask.cpp" -O2 -Wall -fPIC -DNDEBUG  -o ./Release/up_shared_ZipTask.cpp.o -I. -I. -I../shared -I../shared/CoronaEnterprise/shared/include -I../shared/minizip 
In file included from ../shared/ZipTask.cpp:10:
../shared/main_zip.h:227:13: warning: extra tokens at end of #ifdef directive
  227 | #ifdef unix || __APPLE__
      |             ^~
../shared/main_zip.h: In function ‘int isLargeFile(const char*)’:
../shared/main_zip.h:186:9: warning: unused variable ‘n’ [-Wunused-variable]
  186 |     int n = FSEEKO_FUNC(pFile, 0, SEEK_END);
      |         ^
In file included from ../shared/ZipTask.cpp:9:
../shared/ZipTask.h: In constructor ‘Corona::ZipTaskExtract::ZipTaskExtract(std::string, std::string, std::string*, Corona::LMap*, bool, CoronaLuaRef)’:
../shared/ZipTask.h:63:23: warning: ‘Corona::ZipTaskExtract::fFileNames’ will be initialized after [-Wreorder]
   63 |                 LMap *fFileNames;
      |                       ^~~~~~~~~~
../shared/ZipTask.h:60:29: warning:   ‘std::string Corona::ZipTaskExtract::fPathSource’ [-Wreorder]
   60 |                 std::string fPathSource;
      |                             ^~~~~~~~~~~
../shared/ZipTask.cpp:29:9: warning:   when initialized here [-Wreorder]
   29 |         ZipTaskExtract::ZipTaskExtract( std::string pathSource,
      |         ^~~~~~~~~~~~~~
../shared/ZipTask.h:64:22: warning: ‘Corona::ZipTaskExtract::fFlattenOutput’ will be initialized after [-Wreorder]
   64 |                 bool fFlattenOutput;
      |                      ^~~~~~~~~~~~~~
../shared/ZipTask.h:62:30: warning:   ‘std::string* Corona::ZipTaskExtract::fPassword’ [-Wreorder]
   62 |                 std::string *fPassword;
      |                              ^~~~~~~~~
../shared/ZipTask.cpp:29:9: warning:   when initialized here [-Wreorder]
   29 |         ZipTaskExtract::ZipTaskExtract( std::string pathSource,
      |         ^~~~~~~~~~~~~~
../shared/ZipTask.h:62:30: warning: ‘Corona::ZipTaskExtract::fPassword’ will be initialized after [-Wreorder]
   62 |                 std::string *fPassword;
      |                              ^~~~~~~~~
../shared/ZipTask.h:61:29: warning:   ‘std::string Corona::ZipTaskExtract::fOutputDir’ [-Wreorder]
   61 |                 std::string fOutputDir;
      |                             ^~~~~~~~~~
../shared/ZipTask.cpp:29:9: warning:   when initialized here [-Wreorder]
   29 |         ZipTaskExtract::ZipTaskExtract( std::string pathSource,
      |         ^~~~~~~~~~~~~~
../shared/ZipTask.cpp: In member function ‘virtual void Corona::ZipTaskExtract::Execute(Corona::CommandInterface*)’:
../shared/ZipTask.cpp:183:59: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<std::__cxx11::basic_string<char> >::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
  183 |                                         for (int i = 0; i < keys.size(); i++)
      |                                                         ~~^~~~~~~~~~~~~
../shared/ZipTask.cpp:67:29: warning: variable ‘ret_value’ set but not used [-Wunused-but-set-variable]
   67 |                         int ret_value=0;
      |                             ^~~~~~~~~
../shared/ZipTask.cpp: In member function ‘virtual void Corona::ZipTaskListAllFilesInZip::Execute(Corona::CommandInterface*)’:
../shared/ZipTask.cpp:330:37: warning: variable ‘string_method’ set but not used [-Wunused-but-set-variable]
  330 |                         const char *string_method;
      |                                     ^~~~~~~~~~~~~
../shared/ZipTask.cpp:331:30: warning: variable ‘charCrypt’ set but not used [-Wunused-but-set-variable]
  331 |                         char charCrypt=' ';
      |                              ^~~~~~~~~
../shared/main_zip.h: In function ‘int AddToZip(const char*, const char*, const char*, int, const char*)’:
../shared/main_zip.h:970:23: warning: ‘fin’ may be used uninitialized [-Wmaybe-uninitialized]
  970 |                 fclose(fin);
      |                 ~~~~~~^~~~~
../shared/main_zip.h:858:16: note: ‘fin’ was declared here
  858 |         FILE * fin;
      |                ^~~
/usr/bin/gcc -c  "../shared/minizip/ioapi.c" -O2 -Wall -fPIC -DNDEBUG  -o ./Release/up_shared_minizip_ioapi.c.o -I. -I. -I../shared -I../shared/CoronaEnterprise/shared/include -I../shared/minizip 
/usr/bin/g++  -c  "../shared/ZipEvent.cpp" -O2 -Wall -fPIC -DNDEBUG  -o ./Release/up_shared_ZipEvent.cpp.o -I. -I. -I../shared -I../shared/CoronaEnterprise/shared/include -I../shared/minizip 
/usr/bin/gcc -c  "../shared/minizip/unzip.c" -O2 -Wall -fPIC -DNDEBUG  -o ./Release/up_shared_minizip_unzip.c.o -I. -I. -I../shared -I../shared/CoronaEnterprise/shared/include -I../shared/minizip 
../shared/minizip/unzip.c: In function ‘unzOpenCurrentFile3’:
../shared/minizip/unzip.c:1619:24: error: assignment to ‘const long unsigned int *’ from incompatible pointer type ‘const z_crc_t *’ {aka ‘const unsigned int *’} [-Wincompatible-pointer-types]
 1619 |         s->pcrc_32_tab = get_crc_table();
      |                        ^
make[1]: *** [zip.mk:134: Release/up_shared_minizip_unzip.c.o] Error 1
make[1]: Leaving directory '/home/consler/com.coronalabs-plugin.zip/src/linux'
make: *** [Makefile:4: All] Error 2

I don't know if I did anything wrong, that's why I'm mentioning it here.

I've also heard that static building could fix issues like this that but have no clue how to that, when there is an error that I don't know how to fix.

Well, the plugin was made for a version from 2020 but I am pretty sure it's pretty outdated and I had a lot of "just because linux" issues. I am currently using build 2024.3609

I'd also like to point out that if I run Solar2D with wine - everything works, but every now and then it crashed, which is pretty irrelevant info for this issue I guess.

Thanks in advance to anyone, who tries to help : )