kaitz / paq8pxd

GNU General Public License v2.0
68 stars 7 forks source link

Mingw64 compile problems with recommended options #1

Closed d3vv closed 4 years ago

d3vv commented 6 years ago

$ g++ paq8pxd.cpp -DWINDOWS -DMT -msse2 -O3 -s -static -o paq8pxd.exe paq8pxd.cpp:554:0: warning: "MT" redefined

define MT //uncomment for multithreading, compression only

:0:0: note: this is the location of the previous definition C:\msys64\tmp\cclTlQgb.o:paq8pxd.cpp:(.text+0x17588): undefined reference to `inflateInit_' C:\msys64\tmp\cclTlQgb.o:paq8pxd.cpp:(.text+0x17630): undefined reference to `deflateInit2_' C:\msys64\tmp\cclTlQgb.o:paq8pxd.cpp:(.text+0x1787a): undefined reference to `deflate' C:\msys64\tmp\cclTlQgb.o:paq8pxd.cpp:(.text+0x178f0): undefined reference to `inflate' C:\msys64\tmp\cclTlQgb.o:paq8pxd.cpp:(.text+0x17bc5): undefined reference to `deflateEnd' C:\msys64\tmp\cclTlQgb.o:paq8pxd.cpp:(.text+0x17be0): undefined reference to `inflateEnd' C:\msys64\tmp\cclTlQgb.o:paq8pxd.cpp:(.text+0x17de5): undefined reference to `inflateInit_' C:\msys64\tmp\cclTlQgb.o:paq8pxd.cpp:(.text+0x17e8c): undefined reference to `inflate' C:\msys64\tmp\cclTlQgb.o:paq8pxd.cpp:(.text+0x17f6c): undefined reference to `deflateEnd' C:\msys64\tmp\cclTlQgb.o:paq8pxd.cpp:(.text+0x17fc7): undefined reference to `inflateInit2_' C:\msys64\tmp\cclTlQgb.o:paq8pxd.cpp:(.text+0x18022): undefined reference to `inflateInit2_' C:\msys64\tmp\cclTlQgb.o:paq8pxd.cpp:(.text+0x182c2): undefined reference to `deflateInit2_' C:\msys64\tmp\cclTlQgb.o:paq8pxd.cpp:(.text+0x183ad): undefined reference to `deflate' C:\msys64\tmp\cclTlQgb.o:paq8pxd.cpp:(.text+0x184a4): undefined reference to `deflateEnd' C:\msys64\tmp\cclTlQgb.o:paq8pxd.cpp:(.text+0x2845a): undefined reference to `inflate' C:\msys64\tmp\cclTlQgb.o:paq8pxd.cpp:(.text+0x28469): undefined reference to `inflateEnd' C:\msys64\tmp\cclTlQgb.o:paq8pxd.cpp:(.text+0x2b332): undefined reference to `inflate' C:\msys64\tmp\cclTlQgb.o:paq8pxd.cpp:(.text+0x2b376): undefined reference to `inflateEnd' C:\msys64\tmp\cclTlQgb.o:paq8pxd.cpp:(.text+0xc773): undefined reference to `inflateInit_' C:\msys64\tmp\cclTlQgb.o:paq8pxd.cpp:(.text+0xc793): undefined reference to `inflateInit2_' collect2.exe: error: ld returned 1 exit status
d3vv commented 6 years ago

P.S. just need -lz into command line

but we have warning below:

g++ paq8pxd.cpp -DWINDOWS -DMT -msse2 -O3 -s -static -o paq8pxd.exe -lz paq8pxd.cpp:554:0: warning: "MT" redefined

define MT //uncomment for multithreading, compression only

:0:0: note: this is the location of the previous definition
d3vv commented 6 years ago

And my suggestion is to view those warnings via " g++ paq8pxd.cpp -DWINDOWS -DMT -O3 -msse -msse3 -s -static -flto -lz -Wall -Wcast-qual -pedantic -Wextra -Wshadow -o paq8pxd"

warnings.zip

d3vv commented 6 years ago

if label about ton of warnings, could You resolve most obvious warnings with flags below and I will try to help with others?

-Wall -Wcast-qual -Wshadow -Wextra -pedantic

-Weffc++ -Wnon-virtual-dtor -Wold-style-cast -Wsign-conversion -Wconversion