Open Surge Forum

A fun 2D retro platformer inspired by Sonic games and a game creation system

You are not logged in.

Announcement

Our community has moved to Discord! https://discord.gg/w8JqM7m

#1 2019-12-05 17:31:45

KZR
Member
Registered: 2010-07-14
Posts: 1,447
Website

Error compiling zlib

trying to follow the compilation instructions on the wiki but at this point it breaks and I'm not sure what to do about it

> make -f win32/Makefile.gcc install
gcc  -O3 -Wall -c -o adler32.o adler32.c
gcc  -O3 -Wall -c -o compress.o compress.c
gcc  -O3 -Wall -c -o crc32.o crc32.c
gcc  -O3 -Wall -c -o deflate.o deflate.c
gcc  -O3 -Wall -c -o gzclose.o gzclose.c
gcc  -O3 -Wall -c -o gzlib.o gzlib.c
gzlib.c: In function ‘gz_open’:
gzlib.c:14:17: warning: implicit declaration of function ‘lseek’ [-Wimplicit-function-declaration]
 #  define LSEEK lseek
                 ^
gzlib.c:252:9: note: in expansion of macro ‘LSEEK’
         LSEEK(state->fd, 0, SEEK_END);  /* so gzoffset() is correct */
         ^
gcc  -O3 -Wall -c -o gzread.o gzread.c
gzread.c: In function ‘gz_load’:
gzread.c:35:15: warning: implicit declaration of function ‘read’ [-Wimplicit-function-declaration]
         ret = read(state->fd, buf + *have, get);
               ^
gzread.c: In function ‘gzclose_r’:
gzread.c:651:11: warning: implicit declaration of function ‘close’ [-Wimplicit-function-declaration]
     ret = close(state->fd);
           ^
gcc  -O3 -Wall -c -o gzwrite.o gzwrite.c
gzwrite.c: In function ‘gz_comp’:
gzwrite.c:89:20: warning: implicit declaration of function ‘write’ [-Wimplicit-function-declaration]
             writ = write(state->fd, strm->next_in, put);
                    ^
gzwrite.c: In function ‘gzclose_w’:
gzwrite.c:661:9: warning: implicit declaration of function ‘close’ [-Wimplicit-function-declaration]
     if (close(state->fd) == -1)
         ^
gcc  -O3 -Wall -c -o infback.o infback.c
gcc  -O3 -Wall -c -o inffast.o inffast.c
gcc  -O3 -Wall -c -o inflate.o inflate.c
gcc  -O3 -Wall -c -o inftrees.o inftrees.c
gcc  -O3 -Wall -c -o trees.o trees.c
gcc  -O3 -Wall -c -o uncompr.o uncompr.c
gcc  -O3 -Wall -c -o zutil.o zutil.c
ar rcs libz.a adler32.o compress.o crc32.o deflate.o gzclose.o gzlib.o gzread.o gzwrite.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o 
windres --define GCC_WINDRES -o zlibrc.o win32/zlib1.rc
make: windres: Command not found
win32/Makefile.gcc:123: recipe for target 'zlibrc.o' failed
make: [zlibrc.o] Error 127 (ignored)
gcc -shared -Wl,--out-implib,libz.dll.a  \
-o zlib1.dll win32/zlib.def adler32.o compress.o crc32.o deflate.o gzclose.o gzlib.o gzread.o gzwrite.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o  zlibrc.o
gcc: error: zlibrc.o: No such file or directory
win32/Makefile.gcc:96: recipe for target 'zlib1.dll' failed
make: [zlib1.dll] Error 1 (ignored)
strip zlib1.dll
strip: 'zlib1.dll': No such file
win32/Makefile.gcc:96: recipe for target 'zlib1.dll' failed
make: [zlib1.dll] Error 1 (ignored)
if [ "0" = "1" ]; then \
    mkdir -p '/home/kzr/allegro-5.2.5.0/deps/bin'; \
    cp -fp zlib1.dll '/home/kzr/allegro-5.2.5.0/deps/bin'; \
    cp -fp libz.dll.a '/home/kzr/allegro-5.2.5.0/deps/lib'; \
fi
cp -fp zlib.h '/home/kzr/allegro-5.2.5.0/deps/include'
cp -fp zconf.h '/home/kzr/allegro-5.2.5.0/deps/include'
cp -fp libz.a '/home/kzr/allegro-5.2.5.0/deps/lib'
sed \
    -e 's|@prefix@|/usr/local|g' \
    -e 's|@exec_prefix@|/usr/local|g' \
    -e 's|@libdir@|/home/kzr/allegro-5.2.5.0/deps/lib|g' \
    -e 's|@sharedlibdir@|/home/kzr/allegro-5.2.5.0/deps/lib|g' \
    -e 's|@includedir@|/home/kzr/allegro-5.2.5.0/deps/include|g' \
    -e 's|@VERSION@|'`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' zlib.h`'|g' \
    zlib.pc.in > '/home/kzr/allegro-5.2.5.0/deps/lib'/pkgconfig/zlib.pc
kzr@kzr-VirtualBox:~/allegro-5.2.5.0/deps/zlib-1.2.11/zlib-1.2.11$ make install
make: *** No rule to make target 'install'.  Stop.

SD_sml.pngSeD_sml.pngLTot_W_sml.png
https://discord.gg/w8JqM7m ---> Open Surge's Discord server

Offline

#2 2019-12-05 19:52:53

Alexandre
Administrator
From: Brazil
Registered: 2009-01-27
Posts: 3,272
Website

Re: Error compiling zlib

Are you trying to compile for Linux or for Windows?

The process of compiling for Linux is much simpler. You may use your package manager to get a compiled version of Allegro.

If you're trying to compile for Windows, make sure you run the entire line:

BINARY_PATH=${ALLEGRO_DEPS_FOLDER}/bin \
  INCLUDE_PATH=${ALLEGRO_DEPS_FOLDER}/include \
  LIBRARY_PATH=${ALLEGRO_DEPS_FOLDER}/lib \
  make -f win32/Makefile.gcc install

that's a single line, copy and paste it at once. Don't forget to run the following first:

sed -e s/"PREFIX ="/"PREFIX = ${TOOLSET}-"/ -i win32/Makefile.gcc

All environment variables must be set, as described in the wiki.

Offline

#3 2019-12-06 10:18:37

KZR
Member
Registered: 2010-07-14
Posts: 1,447
Website

Re: Error compiling zlib

I'm compiling on Linux (Ubuntu Gnome 16.04) and following the wiki's instructions. As soon as I get to zlib compilation fails with the log above

Also my package manager seems to be missing??

I did manage to install Allegro 5 via ppa, but it seems that zlib is missing a file required to compile, which is strange because I got the right version via wget

Last edited by KZR (2019-12-06 10:26:08)


SD_sml.pngSeD_sml.pngLTot_W_sml.png
https://discord.gg/w8JqM7m ---> Open Surge's Discord server

Offline

#4 2019-12-06 15:40:10

Alexandre
Administrator
From: Brazil
Registered: 2009-01-27
Posts: 3,272
Website

Re: Error compiling zlib

If you installed liballegro5-dev, you don't need to compile zlib and the other libs. Just compile SurgeScript before the game and you're ready to go.

Instructions here:
- https://github.com/alemart/surgescript
- https://github.com/alemart/opensurge

The MinGW toolchain is for cross-compiling for Windows, not your case.

Offline

#5 2019-12-08 13:42:46

KZR
Member
Registered: 2010-07-14
Posts: 1,447
Website

Re: Error compiling zlib

Turns out the problem was me entering the windows commands in the linux console. The wiki has them all in one block and the guide specified to use linux. That's where I got confused

Are you going to keep the internal resolution hard-coded? I don't really mind messing around with the source code, but since my hi-res hack of build 760 has gathered some interest, I think users could benefit from, say, a .ini file where they could change the engine's internal resolution, aside of the upscaling factor already present in the options menu.

Especially now with Allegro 5, the engine should not chug anymore when presented with multiple alpha blended sprites, or many entities on screen at higher resolutions

Last edited by KZR (2019-12-08 20:52:20)


SD_sml.pngSeD_sml.pngLTot_W_sml.png
https://discord.gg/w8JqM7m ---> Open Surge's Discord server

Offline

#6 2019-12-12 17:56:00

Alexandre
Administrator
From: Brazil
Registered: 2009-01-27
Posts: 3,272
Website

Re: Error compiling zlib

KZR wrote:

Are you going to keep the internal resolution hard-coded?

No, being able to change the native resolution using a configuration file is planned. The HUD should be updated to accommodate different sizes as well, so it's a bit more work. Ideally, the configurable size should accompany the ability to expand the collision sensors of the players (that's harder to do properly).

The engine now works fine with alpha blending. Changing the native resolution via the source code for now will work just fine as well.

Offline

#7 2019-12-13 16:26:29

KZR
Member
Registered: 2010-07-14
Posts: 1,447
Website

Re: Error compiling zlib

Can't find Allegro 5 lib (liballegro_monolith-static).  You might get some
  luck by tweaking CMake options with ccmake | cmake-gui, or you can get help
  at opensurge2d.org

I have installed allegro  with the package manager. what am i missing?


SD_sml.pngSeD_sml.pngLTot_W_sml.png
https://discord.gg/w8JqM7m ---> Open Surge's Discord server

Offline

#8 2019-12-13 17:39:34

Alexandre
Administrator
From: Brazil
Registered: 2009-01-27
Posts: 3,272
Website

Re: Error compiling zlib

KZR wrote:

I have installed allegro  with the package manager. what am i missing?

The wiki instructions are for cross-compiling. Since you're natively compiling for Linux, instructions are much simpler. You may start over and follow the instructions below:
- https://github.com/alemart/surgescript
- https://github.com/alemart/opensurge

In particular, you shouldn't use the monolith version of Allegro; that's what I use for Windows. Compile Open Surge normally. Extract it to a new folder and run:

cd /path/to/opensurge
mkdir build && cd build
cmake ..
make
sudo make install

Offline

#9 2019-12-14 06:16:07

KZR
Member
Registered: 2010-07-14
Posts: 1,447
Website

Re: Error compiling zlib

Is it better if I compile in windows for windows?


SD_sml.pngSeD_sml.pngLTot_W_sml.png
https://discord.gg/w8JqM7m ---> Open Surge's Discord server

Offline

#10 2019-12-14 12:45:13

Alexandre
Administrator
From: Brazil
Registered: 2009-01-27
Posts: 3,272
Website

Re: Error compiling zlib

KZR wrote:

Is it better if I compile in windows for windows?

It is easier.

1. Get a precompiled version of Allegro at https://github.com/liballeg/allegro5/releases
2. Find a compiler version that is compatible with the precompiled Allegro (e.g., gcc 8.2.1 or gcc 7.4.0)
3. Get CMake at https://cmake.org
4. Compile SurgeScript: https://github.com/alemart/surgescript
5. Compile Open Surge: https://github.com/alemart/opensurge

When compiling Open Surge, I suggest enabling ALLEGRO_STATIC in CMake, so you don't have to ship a bunch of DLLs with your executable.

If you want to use a different version of the compiler, you must compile Allegro by yourself. This is more difficult than using the precompiled version, but Edgar Reynaldo from allegro.cc has put together a really nice guide: http://members.allegro.cc/EdgarReynaldo/BuildA5.html

If you succeed in compiling in Windows, let me know, so we can write instructions on the wiki. It should be easy.

Offline

#11 2019-12-15 20:17:30

KZR
Member
Registered: 2010-07-14
Posts: 1,447
Website

Re: Error compiling zlib

ok. I'll try that.

Also please let me know as soon as the RPi version is ready for testing. I can help you with that, and when it's playable, I'm sure my son would love to help too since he is also a Sonic fan smile


SD_sml.pngSeD_sml.pngLTot_W_sml.png
https://discord.gg/w8JqM7m ---> Open Surge's Discord server

Offline

#12 2019-12-16 00:39:33

Alexandre
Administrator
From: Brazil
Registered: 2009-01-27
Posts: 3,272
Website

Re: Error compiling zlib

KZR wrote:

Also please let me know as soon as the RPi version is ready for testing. I can help you with that, and when it's playable, I'm sure my son would love to help too since he is also a Sonic fan

Since Allegro 5 is available for the RPi, you may compile it right away.

Offline

#13 2019-12-19 13:36:18

KZR
Member
Registered: 2010-07-14
Posts: 1,447
Website

Re: Error compiling zlib

Interesting. I thought you had to change the source code. I'll let you know once I have progress. It would be pretty cool to have an SD card full of Surge mods big_smile

but still on the Win/Lin compilation, the wiki is a bit confusing as the instructions don't clearly specify what's for Windows and what's for Linux. I do appreciate you taking your time to document everything in detail, but for someone with little to no background in programming, things get messy pretty quick


SD_sml.pngSeD_sml.pngLTot_W_sml.png
https://discord.gg/w8JqM7m ---> Open Surge's Discord server

Offline

#14 2019-12-19 21:24:30

Alexandre
Administrator
From: Brazil
Registered: 2009-01-27
Posts: 3,272
Website

Re: Error compiling zlib

KZR wrote:

It would be pretty cool to have an SD card full of Surge mods big_smile

That's indeed possible. I believe it's possible to port Open Surge to platforms such as RetroPie and ClockworkPi GameShell (Linux) simply by compiling it.

KZR wrote:

but still on the Win/Lin compilation, the wiki is a bit confusing as the instructions don't clearly specify what's for Windows and what's for Linux. I do appreciate you taking your time to document everything in detail, but for someone with little to no background in programming, things get messy pretty quick

The Win/Linux is a cross compiling guide. It says:

We'll compile a Windows build of the game from a Linux box. We'll first compile Allegro 5 and its dependencies. Then, we'll compile SurgeScript. Finally, we'll compile Open Surge.

Since we're building everything from the sources, the instructions below can be adapted to build the game on other platforms, such as Linux and OSX (there are hints throughout the guide).

I agree it can get difficult if you're a non-programmer, it's advanced. If you succeed in compiling in Windows directly, it would benefit the entire community if you write your findings on the wiki. Instructions for Windows are likely to be far simpler if you use the precompiled Allegro.

Offline

#15 2019-12-20 13:37:11

KZR
Member
Registered: 2010-07-14
Posts: 1,447
Website

Re: Error compiling zlib

That's indeed possible. I believe it's possible to port Open Surge to platforms such as RetroPie and ClockworkPi GameShell (Linux) simply by compiling it.

have you ever thought of supporting Retroarch? Cave Story is there, available to download from the main menu and runs perfectly on a Pi


SD_sml.pngSeD_sml.pngLTot_W_sml.png
https://discord.gg/w8JqM7m ---> Open Surge's Discord server

Offline

#16 2019-12-20 14:26:55

Alexandre
Administrator
From: Brazil
Registered: 2009-01-27
Posts: 3,272
Website

Re: Error compiling zlib

KZR wrote:

have you ever thought of supporting Retroarch?

not right now, but who knows about the future.

Offline

Board footer

Powered by FluxBB  hosted by tuxfamily.org