Log in

View Full Version : How to upgrade and compile with GCC?


Jamaika
12th March 2016, 08:55
Last downloaded files yourself:
tdm64-gcc-5.1.0-2.exe
FLIF-master.zip
Writes the command and something is still missing:
gcc.exe -v -m64 -std=gnu++11 -mtune=generic -mthreads -march=x86-64 flif.cpp -o flif.exe --> Error

How to do it?

LoRd_MuldeR
12th March 2016, 12:56
Without even telling us what error you get, it's obviously impossible to give any useful advice...

nevcairiel
12th March 2016, 13:14
Most projects come with build instructions or at least a makefile or a configure script, you should probably start there.

Jamaika
12th March 2016, 13:19
Without even telling us what error you get, it's obviously impossible to give any useful advice...
Errors are thousands so do not even try to post. Generally gcc asks for additional commands, which is a hundred.
It is a pity that the authors github programs don't provide instructions.:confused:
collect2.exe: error: ld returned 1 exit status
Most projects come with build instructions or at least a makefile or a configure script, you should probably start there.
How does the makefile in Windows run? GCC doesn't want to import this file.
flif:
cd src && $(MAKE)

install:
cd src && $(MAKE) install

LoRd_MuldeR
12th March 2016, 14:15
Errors are thousands so do not even try to post. Generally gcc asks for additional commands, which is a hundred.
It is a pity that the authors github programs don't provide instructions.:confused:
collect2.exe: error: ld returned 1 exit status

This just means linking failed. You will need to dig into the details to figure out why linking failed.


How does the makefile in Windows run? GCC doesn't want to import this file.
flif:
cd src && $(MAKE)

install:
cd src && $(MAKE) install

There is GNU Make (and many other required standard POSIX tools) included in MSYS/MSYS2. Typically MSYS/MSYS2 is used as a supplement to MinGW in order to get stuff built.

(BTW: The snippet from the Makefile that you are showing just says "go to 'src' directory and call make again")

lvqcl
12th March 2016, 14:26
Build instructions are available at https://github.com/FLIF-hub/FLIF#build-instructions

You need GCC and MSYS (MSYS2). It seems that you also need to download libpng sources, compile and install it.

Jamaika
13th March 2016, 09:08
This just means linking failed. You will need to dig into the details to figure out why linking failed.")
Here is my defeat.
There is GNU Make (and many other required standard POSIX tools) included in MSYS/MSYS2. Typically MSYS/MSYS2 is used as a supplement to MinGW in order to get stuff built.
I downloaded MSYS/MSYS2 and I don't know where to start. It seems to be a foreign operating system.")
(BTW: The snippet from the Makefile that you are showing just says "go to 'src' directory and call make again")
My mistake. The code in src is here.
The problem is such that I don't see a reference to compile the .exe file.
PREFIX := $(DESTDIR)/usr
CXXFLAGS := $(shell pkg-config --cflags zlib libpng)
LDFLAGS := $(shell pkg-config --libs libpng)

OSNAME := $(shell uname -s)
SONAME = -soname
ifeq ($(OSNAME),Darwin)
SONAME = -install_name
endif

# for running interface-test
export LD_LIBRARY_PATH=$(shell pwd):$LD_LIBRARY_PATH

FILES_H := maniac/*.hpp maniac/*.cpp image/*.hpp transform/*.hpp flif-enc.hpp flif-dec.hpp common.hpp flif_config.h fileio.hpp io.hpp io.cpp config.h compiler-specific.hpp
FILES_CPP := maniac/chance.cpp maniac/symbol.cpp image/crc32k.cpp image/image.cpp image/image-png.cpp image/image-pnm.cpp image/image-pam.cpp image/image-rggb.cpp image/color_range.cpp transform/factory.cpp common.cpp flif-enc.cpp flif-dec.cpp io.cpp

all: flif libflif_dec.so libflif.so viewflif
lgpl: libflif_dec.so viewflif dflif

# options to consider: -fvect-cost-model=unlimited -funroll-all-loops
OPTIMIZATIONS := -DNDEBUG -O2 -ftree-vectorize
# there are often problems with clang and lto also it doesn't seem to know -fwhole-program
ifeq ($(CXX), g++)
OPTIMIZATIONS := $(OPTIMIZATIONS) -flto -fwhole-program
endif

LIB_OPTIMIZATIONS := -DNDEBUG -O2
ifeq ($(CXX), g++)
LIB_OPTIMIZATIONS := $(LIB_OPTIMIZATIONS) -flto
endif

# Command-line FLIF encoding/decoding tool - GPL
flif: $(FILES_H) $(FILES_CPP) flif.cpp
$(CXX) -std=gnu++11 $(CXXFLAGS) $(OPTIMIZATIONS) -g0 -Wall $(FILES_CPP) flif.cpp $(LDFLAGS) -o flif

# Command-line FLIF decoding tool - LGPL
dflif: $(FILES_H) $(FILES_CPP) flif.cpp
$(CXX) -std=gnu++11 $(CXXFLAGS) $(OPTIMIZATIONS) -DDECODER_ONLY -g0 -Wall $(FILES_CPP) flif.cpp $(LDFLAGS) -o dflif

# Decoder-only library - LGPL
libflif_dec.so: $(FILES_H) $(FILES_CPP) library/flif_dec.h library/flif-interface-private_dec.hpp library/flif-interface_dec.cpp
echo $(OS)
$(CXX) -std=gnu++11 $(CXXFLAGS) $(LIB_OPTIMIZATIONS) -DDECODER_ONLY -g0 -Wall -shared -fPIC $(FILES_CPP) library/flif-interface_dec.cpp $(LDFLAGS) -Wl,$(SONAME),libflif_dec.so.0 -o libflif_dec.so.0
ln -sf libflif_dec.so.0 libflif_dec.so

# Encoder-only library - GPL - probably not that useful (not built by default)
libflif_enc.so: $(FILES_H) $(FILES_CPP) library/flif_enc.h library/flif-interface-private_enc.hpp library/flif-interface_enc.cpp
$(CXX) -std=gnu++11 $(CXXFLAGS) $(LIB_OPTIMIZATIONS) -g0 -Wall -shared -fPIC $(FILES_CPP) library/flif-interface_enc.cpp $(LDFLAGS) -Wl,$(SONAME),libflif_enc.so.0 -o libflif_enc.so.0
ln -sf libflif_enc.so.0 libflif_enc.so

# Decoder + encoder library - GPL
libflif.so: $(FILES_H) $(FILES_CPP) library/*.h library/*.hpp library/*.cpp
$(CXX) -std=gnu++11 $(CXXFLAGS) $(LIB_OPTIMIZATIONS) -g0 -Wall -shared -fPIC $(FILES_CPP) library/flif-interface.cpp $(LDFLAGS) -Wl,$(SONAME),libflif.so.0 -o libflif.so.0
ln -sf libflif.so.0 libflif.so

libflif.dbg.so: $(FILES_H) $(FILES_CPP) library/*.h library/*.hpp library/*.cpp
$(CXX) -std=gnu++11 $(CXXFLAGS) -O1 -ggdb3 -Wall -shared -fPIC $(FILES_CPP) library/flif-interface.cpp $(LDFLAGS) -Wl,$(SONAME),libflif.so.0 -o libflif.dbg.so.0
ln -sf libflif.dbg.so.0 libflif.dbg.so

# Example application: simple FLIF viewer - public domain
viewflif: libflif_dec.so viewflif.c
$(CC) -std=gnu11 -O3 -ggdb3 $(shell sdl2-config --cflags) -Wall -Ilibrary/ viewflif.c -L. -lflif_dec $(shell sdl2-config --libs) -o viewflif


install: all
install -d $(PREFIX)/bin $(PREFIX)/lib $(PREFIX)/share/man/man1
install -s -m 755 flif viewflif $(PREFIX)/bin
install -s -m 755 libflif_dec.so.* $(PREFIX)/lib
install -s -m 755 libflif.so.* $(PREFIX)/lib
install -m 644 ../doc/flif.1 $(PREFIX)/share/man/man1
install -m 755 ../tools/gif2flif $(PREFIX)/bin
install -m 755 ../tools/apng2flif $(PREFIX)/bin

install-dev:
install -m 644 library/*.h $(PREFIX)/include

magic:
if ! grep -q FLIF /etc/magic; then cat ../doc/flif.magic >> /etc/magic; fi

uninstall:
rm -f $(PREFIX)/bin/flif
rm -f $(PREFIX)/bin/viewflif
rm -f $(PREFIX)/bin/gif2flif
rm -f $(PREFIX)/bin/apng2flif
rm -f $(PREFIX)/lib/libflif.so
rm -f $(PREFIX)/lib/libflif_dec.so
rm -f $(PREFIX)/lib/libflif.so.0
rm -f $(PREFIX)/lib/libflif_dec.so.0
rm -f $(PREFIX)/share/man/man1/flif.1

clean:
rm -f flif dflif libflif*.so* viewflif flif.asan flif.dbg flif.prof flif.stats test-interface


# The targets below are only meant for developers

test-interface: libflif.dbg.so ../tools/test.c
$(CC) -O0 -ggdb3 -Wall -Ilibrary/ ../tools/test.c -L. -lflif.dbg -o test-interface

test: flif test-interface
mkdir -p ../tmp-test
./test-interface ../tmp-test/dummy.flif
../tools/test-roundtrip.sh ../tools/2_webp_ll.png ../tmp-test/2_webp_ll.flif ../tmp-test/decoded_2_webp_ll.png
../tools/test-roundtrip.sh ../tools/kodim01.png ../tmp-test/kodim01.flif ../tmp-test/decoded_kodim01.png
../tools/test-roundtrip_anim.sh ../tools/endless_war.gif ../tmp-test/endless_war.flif
../tools/test-roundtrip_anim_framedir.sh ../tools/bouncing_ball_frames ../tmp-test/bouncing_ball.flif

flif.stats: $(FILES_H) $(FILES_CPP) flif.cpp
$(CXX) -std=gnu++11 $(CXXFLAGS) -DSTATS $(OPTIMIZATIONS) -g0 -Wall $(FILES_CPP) flif.cpp $(LDFLAGS) -o flif.stats

flif.prof: $(FILES_H) $(FILES_CPP) flif.cpp
$(CXX) -std=gnu++11
Build instructions are available at https://github.com/FLIF-hub/FLIF#build-instructions
Great instruction. Windows is littered with Visual Studio 2015. I added flif.cpp. Then I can't compile (F5) because progam isn't compile CPP.:mad:

Problem with update GCC:
Yet one thing puzzles me. I updated tdm64-gcc-5.1.0-2.exe adding gcc-6-win64_6.0.0-20160301.7z (https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/dongsheng-daily/6.x/gcc-6-win64_6.0.0-20160301.7z/download). Everything would be fine if not for the fact that the commands don't work in Windows.

Jamaika
19th March 2016, 13:25
Once again I struggled with the GCC.
I recorded another compiler, newer v5.3.0: https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/installer/
I have uploaded the files to the appropriate directory libpng GCC:
https://sourceforge.net/projects/libpng/files/?source=navbar
c:/program files/ming_w64/../mingw64/x86_64-w64_mingw32/include/*.*
I compiled all files (visual c ++) .cpp to .o
gcc.exe -std=gnu++11 -m64 -g0 -Wall -DNDEBUG -O2 -ftree-vectorize -c 'single file'.cpp -o 'single file'.o
Then I created .exe file. Unfortunately with errors.
gcc.exe -std=gnu++11 -m64 'all files'.o -o flif.exe

My created files: https://www.sendspace.com/file/bvk9qp

LoRd_MuldeR
19th March 2016, 14:20
I compiled all files (visual c ++) .cpp to .o

You generally can not mix object code files or "static" libraries (which are just archives containing object code files) from different compilers.

What may work is mixing DLL's compiled by different compilers, but only as long as we are talking about "plain C" DLL's. As soon as C++ symbols are exposed from the DLL, you are doomed due to incompatible name managing and other issues.

Jamaika
19th March 2016, 15:21
You generally can not mix object code files or "static" libraries (which are just archives containing object code files) from different compilers.
Maybe pertinent comment, but it surprised me. There are threads in the web that speak of the compiled .exe with .o.
What are my the conclusions?
My mistake was such that I used gcc.exe rather than g++.exe.
Gcc doesn't include libraries .hpp / .h / .c.
When this is corrected remained one mistake. Faulty libpng. ):
C:\Users\KOMPUT~1\AppData\Local\Temp\ccYnuSo8.o:image-png.cpp:(.text+0x48): undefined reference to `png_create_write_struct'
C:\Users\KOMPUT~1\AppData\Local\Temp\ccYnuSo8.o:image-png.cpp:(.text+0x61): undefined reference to `png_create_info_struct'
C:\Users\KOMPUT~1\AppData\Local\Temp\ccYnuSo8.o:image-png.cpp:(.text+0x84): undefined reference to `png_init_io'
C:\Users\KOMPUT~1\AppData\Local\Temp\ccYnuSo8.o:image-png.cpp:(.text+0x107): undefined reference to `png_set_IHDR'
C:\Users\KOMPUT~1\AppData\Local\Temp\ccYnuSo8.o:image-png.cpp:(.text+0x11c): undefined reference to `png_write_info'
C:\Users\KOMPUT~1\AppData\Local\Temp\ccYnuSo8.o:image-png.cpp:(.text+0x135): undefined reference to `png_malloc'
C:\Users\KOMPUT~1\AppData\Local\Temp\ccYnuSo8.o:image-png.cpp:(.text+0x1f6): undefined reference to `png_write_row'
C:\Users\KOMPUT~1\AppData\Local\Temp\ccYnuSo8.o:image-png.cpp:(.text+0x220): undefined reference to `png_free'
C:\Users\KOMPUT~1\AppData\Local\Temp\ccYnuSo8.o:image-png.cpp:(.text+0x235): undefined reference to `png_write_end'
C:\Users\KOMPUT~1\AppData\Local\Temp\ccYnuSo8.o:image-png.cpp:(.text+0x24a): undefined reference to `png_destroy_write_struct'
C:\Users\KOMPUT~1\AppData\Local\Temp\ccYnuSo8.o:image-png.cpp:(.text+0x2ea): undefined reference to `png_destroy_write_struct'
C:\Users\KOMPUT~1\AppData\Local\Temp\ccYnuSo8.o:image-png.cpp:(.text+0x3e2): undefined reference to `png_sig_cmp'
C:\Users\KOMPUT~1\AppData\Local\Temp\ccYnuSo8.o:image-png.cpp:(.text+0x430): undefined reference to `png_create_read_struct'
C:\Users\KOMPUT~1\AppData\Local\Temp\ccYnuSo8.o:image-png.cpp:(.text+0x449): undefined reference to `png_create_info_struct'
C:\Users\KOMPUT~1\AppData\Local\Temp\ccYnuSo8.o:image-png.cpp:(.text+0x46a): undefined reference to `png_init_io'
C:\Users\KOMPUT~1\AppData\Local\Temp\ccYnuSo8.o:image-png.cpp:(.text+0x47c): undefined reference to `png_set_sig_bytes'
C:\Users\KOMPUT~1\AppData\Local\Temp\ccYnuSo8.o:image-png.cpp:(.text+0x49a): undefined reference to `png_read_png'
C:\Users\KOMPUT~1\AppData\Local\Temp\ccYnuSo8.o:image-png.cpp:(.text+0x4af): undefined reference to `png_get_image_width'
C:\Users\KOMPUT~1\AppData\Local\Temp\ccYnuSo8.o:image-png.cpp:(.text+0x4c9): undefined reference to `png_get_image_height'
C:\Users\KOMPUT~1\AppData\Local\Temp\ccYnuSo8.o:image-png.cpp:(.text+0x4e8): undefined reference to `png_get_bit_depth'
C:\Users\KOMPUT~1\AppData\Local\Temp\ccYnuSo8.o:image-png.cpp:(.text+0x507): undefined reference to `png_get_color_type'
C:\Users\KOMPUT~1\AppData\Local\Temp\ccYnuSo8.o:image-png.cpp:(.text+0x735): undefined reference to `png_get_rows'
C:\Users\KOMPUT~1\AppData\Local\Temp\ccYnuSo8.o:image-png.cpp:(.text+0x776): undefined reference to `png_destroy_read_struct'
C:\Users\KOMPUT~1\AppData\Local\Temp\ccYnuSo8.o:image-png.cpp:(.text+0x7c3): undefined reference to `png_destroy_read_struct'
collect2.exe: error: ld returned 1 exit status
Who knows where to download the valid library libpng?:helpful:

LoRd_MuldeR
19th March 2016, 15:37
Maybe pertinent comment, but it surprised me. There are threads in the web that speak of the compiled .exe with .o.

Yes, C and/or C++ files a first compiled to object files. And then all object files of a program are linked together (typically with additional libraries) to form an EXE or DLL/SO file.

However, you generally can not mix object files from different compiler! Often even object files from different versions of the same compiler do not go together...


What are my the conclusions?
My mistake was such that I used gcc.exe rather than g++.exe.
Gcc doesn't include libraries .hpp / .h / .c.

gcc is the GNU C Compiler, g++ is the GNU C++ Compiler. If you sourced code is written in C++, you are going to need g++, obviously.


When this is corrected remained one mistake. Faulty libpng. ):
[CODE]C:\Users\KOMPUT~1\AppData\Local\Temp\ccYnuSo8.o:image-png.cpp:(.text+0x48): undefined reference to `png_create_write_struct'
C:\Users\KOMPUT~1\AppData\Local\Temp\ccYnuSo8.o:image-png.cpp:(.text+0x61): undefined reference to `png_create_info_struct'
C:\Users\KOMPUT~1\AppData\Local\Temp\ccYnuSo8.o:image-png.cpp:(.text+0x84): undefined reference to `png_init_io'
C:\Users\KOMPUT~1\AppData\Local\Temp\ccYnuSo8.o:image-png.cpp:(.text+0x107): undefined reference to `png_set_IHDR'
C:\Users\KOMPUT~1\AppData\Local\Temp\ccYnuSo8.o:image-png.cpp:(.text+0x11c): undefined reference to `png_write_info'
C:\Users\KOMPUT~1\AppData\Local\Temp\ccYnuSo8.o:image-png.cpp:(.text+0x135): undefined reference to `png_malloc'
...

These errors indicate that you did link object files that use PNG functions (png_create_write_struct(), png_create_info_struct(), etc. pp.), but you did not link the object files (or shared library) where these functions are actually implemented. So you have a reference to these functions, but the compiler can not resolve it! Most commonly, this indicates that you used (included) the librarie's associated header files in your own code, but you did not actually link the library in the end!

foxyshadis
20th March 2016, 04:50
Once again I struggled with the GCC.
I recorded another compiler, newer v5.3.0: https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/installer/
I have uploaded the files to the appropriate directory libpng GCC:
https://sourceforge.net/projects/libpng/files/?source=navbar
c:/program files/ming_w64/../mingw64/x86_64-w64_mingw32/include/*.*
I compiled all files (visual c ++) .cpp to .o
gcc.exe -stu=gnu++11 -m64 -g0 -Wall -DNDEBUG -O2 -ftree-vectorize -c 'single file'.cpp -o 'single file'.o
Then I created .exe file. Unfortunately with errors.
gcc.exe -stu=gnu++11 -m64 'all files'.o -o flif.exe

My created files: https://www.sendspace.com/file/bvk9qp

Your bug reports are very, very difficult to parse, you should start including at least one actual representative command-line, not an edited one, in the future, and a list of errors, if you want anyone to take a second glance.

That said, I'm sure that the problem here is that you didn't compile the png .c files. Do that and include those .o in the linking and it'll work, you're almost there. Once you get that working, you can work on making libs so you don't have to reference every single .o; a .lib is a collection of related .o files. (Technically they don't have to be related... but it's a good idea.)

And then using make, which automates this whole process so you don't have to deal with writing these command-lines yourself. Let the computer do the tedious repetitive work.

Jamaika
21st March 2016, 09:44
These errors indicate that you did link object files that use PNG functions (png_create_write_struct(), png_create_info_struct(), etc. pp.), but you did not link the object files (or shared library) where these functions are actually implemented. So you have a reference to these functions, but the compiler can not resolve it! Most commonly, this indicates that you used (included) the librarie's associated header files in your own code, but you did not actually link the library in the end!
Your bug reports are very, very difficult to parse, you should start including at least one actual representative command-line, not an edited one, in the future, and a list of errors, if you want anyone to take a second glance.
I didn't know what you mean, but in the end have an idea.

So I write all the commands as I came to success.
Run file 'mingw-w64.bat':
echo off
set PATH=C:\Program Files\mingw-w64\x86_64-5.3.0-posix-seh-rt_v4-rev0\mingw64\bin;%PATH%
rem echo %PATH%
rem cd "C:\Program Files\mingw-w64\x86_64-5.3.0-posix-seh-rt_v4-rev0\mingw64\bin"
cd lp170b79
for %%f in ("%~dp1*.c") do gcc.exe -DNDEBUG -ftree-vectorize -g0 -O2 -flto -c %%f -o %%~nf.o
cd ..
cd zlib-1.2.8
for %%f in ("%~dp1*.c") do gcc.exe -DNDEBUG -ftree-vectorize -g0 -O2 -flto -c %%f -o %%~nf.o
cd ..
g++.exe -std=gnu++11 -DNDEBUG -ftree-vectorize -flto -mcrc32 -m64 -mtune=generic -mthreads -march=x86-64 -g0 -O2 -Wall -Wabi -Wctor-dtor-privacy -Wnon-virtual-dtor -Wreorder -Woverloaded-virtual
maniac\chance.cpp maniac\symbol.cpp image\crc32k.cpp image\image.cpp image\image-png.cpp image\image-pnm.cpp image\image-pam.cpp image\image-rggb.cpp image\color_range.cpp lp170b79\pngerror.o
lp170b79\pngget.o lp170b79\pngmem.o lp170b79\pngpread.o lp170b79\pngread.o lp170b79\pngrio.o lp170b79\pngrtran.o lp170b79\pngrutil.o lp170b79\pngset.o lp170b79\pngtrans.o lp170b79\pngwio.o
lp170b79\pngwrite.o lp170b79\pngwtran.o lp170b79\pngwutil.o lp170b79\png.o transform\factory.cpp common.cpp flif-enc.cpp flif-dec.cpp io.cpp library\flif-interface.cpp flif.cpp zlib-1.2.8\adler32.o
zlib-1.2.8\crc32.o zlib-1.2.8\deflate.o zlib-1.2.8\infback.o zlib-1.2.8\inffast.o zlib-1.2.8\inflate.o zlib-1.2.8\inftrees.o zlib-1.2.8\trees.o zlib-1.2.8\zutil.o -o flif.exe
g++.exe -std=gnu++11 -DNDEBUG -ftree-vectorize -flto -mtune=generic -mcrc32 -m64 -mthreads -march=x86-64 -g0 -O2 -Wall -Wabi -Wctor-dtor-privacy -Wnon-virtual-dtor -Wreorder -Woverloaded-virtual
viewflif.o common.cpp flif-dec.cpp io.cpp library\flif-interface_dec.cpp image\color_range.cpp image\crc32k.cpp maniac\chance.cpp transform\factory.cpp sdl-2.0.4\*.o sdl-2.0.4\atomic\*.o
sdl-2.0.4\audio\*.o sdl-2.0.4\audio\disk\*.o sdl-2.0.4\audio\directsound\*.o sdl-2.0.4\audio\dummy\*.o sdl-2.0.4\audio\winmm\*.o sdl-2.0.4\audio\xaudio2\*.o sdl-2.0.4\core\windows\*.o
sdl-2.0.4\cpuinfo\*.o sdl-2.0.4\dynapi\*.o sdl-2.0.4\events\*.o sdl-2.0.4\file\*.o sdl-2.0.4\filesystem\windows\*.o sdl-2.0.4\haptic\*.o sdl-2.0.4\haptic\windows\*.o sdl-2.0.4\joystick\*.o
sdl-2.0.4\joystick\windows\*.o sdl-2.0.4\libm\*.o sdl-2.0.4\loadso\windows\*.o sdl-2.0.4\main\windows\*.o sdl-2.0.4\power\*.o sdl-2.0.4\power\windows\*.o sdl-2.0.4\render\*.o
sdl-2.0.4\render\direct3d\*.o sdl-2.0.4\render\opengl\*.o sdl-2.0.4\render\opengles2\*.o sdl-2.0.4\render\software\*.o sdl-2.0.4\stdlib\*.o sdl-2.0.4\thread\*.o sdl-2.0.4\thread\generic\*.o
sdl-2.0.4\timer\*.o sdl-2.0.4\timer\windows\*.o sdl-2.0.4\video\*.o sdl-2.0.4\video\dummy\*.o sdl-2.0.4\video\windows\*.o -lwinmm -limm32 -lole32 -loleaut32 -lgdi32 -lversion -o viewflif.exe
pause
Library command always at the end. (All day guessing)

First convert the file 'lp170b79/pngtest.c' when there are no errors, we must remove it. I also didn't have to convert the files 'gzlib.o'.
We compile the file and I was surprised that after compilation need to download system files 'mingw-w64'.
Why the files aren't in the file flif.exe?

Edit:
My files decoder, encoder and viewer + include::cool:
https://www.sendspace.com/file/i76wwo