How to build solar2d on Linux

Hi,
I’m trying to build solar2d Ubuntu 20.04.
But I get:

takeshi:corona$ cmake .
YEAR: 2100
BUILD_NUMBER: 9999
CORONA_ROOT: /home/takeshi/tmp/corona
-- USE_LIBCEF=0
-- zlib-1.2.11; /usr/include; /usr/lib/x86_64-linux-gnu/libz.so
-- OpenGL; /usr/include; /usr/lib/x86_64-linux-gnu/libGL.so;/usr/lib/x86_64-linux-gnu/libGLU.so
-- OpenAL; /usr/include/AL; /usr/lib/x86_64-linux-gnu/libopenal.so
-- Freetype-2.10.1; /usr/include/freetype2; /usr/lib/x86_64-linux-gnu/libfreetype.so
-- png-1.6.37; /usr/include;/usr/include; /usr/lib/x86_64-linux-gnu/libpng.so;/usr/lib/x86_64-linux-gnu/libz.so
-- curl-7.68.0; /usr/include/x86_64-linux-gnu; /usr/lib/x86_64-linux-gnu/libcurl.so
-- Configuring done
CMake Error at platform/linux/CMakeList.txt:906 (add_executable):
  Cannot find source file:

    /home/takeshi/tmp/corona/external/luasocket/src/auxiliar.c

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
  .hpp .hxx .in .txx
Call Stack (most recent call first):
  CMakeLists.txt:39 (include)


CMake Error at platform/linux/CMakeList.txt:906 (add_executable):
  No SOURCES given to target: Solar2DSimulator
Call Stack (most recent call first):
  CMakeLists.txt:39 (include)


CMake Error at platform/linux/CMakeList.txt:869 (add_executable):
  No SOURCES given to target: Solar2D
Call Stack (most recent call first):
  CMakeLists.txt:39 (include)


CMake Error at platform/linux/CMakeList.txt:943 (add_executable):
  No SOURCES given to target: Solar2DBuilder
Call Stack (most recent call first):
  CMakeLists.txt:39 (include)


CMake Generate step failed.  Build files cannot be regenerated correctly.
takeshi:corona$ 

I can see the corona/external/luasocket/ folder is empty.
I could get the luasocket source code and add it to it but I suppose this is not how devs are setting up their environments (and I actually tried this and it worked but other missing things popped up).
Can someone show me how to build on Linux?

If your external luasocket folder is empty, I am guessing you hit code>download zip or download source code from release which can cause a lot of problems.

I recommend cloning the project via git
https://git-scm.com/book/en/v2/Git-Basics-Getting-a-Git-Repository

Ah, I used git but cloned it this way:

git clone https://github.com/coronalabs/corona

But checking the external/luasocket file at the github GUI I saw:

luasocket @ c7566c8

which is of course some sort of link to a commit in another repo.

This is the first time I encountered such kind of thing (I was not expecting it since other external libraries sources were present in the corona repo).

So I did:

git clone --recursive https://github.com/coronalabs/corona

and after that I could build and install by doing:

cd corona/
cmake .
make 
sudo make install

Thanks.

1 Like