richgel999 / lzham_codec

Lossless data compression codec with LZMA-like ratios but 1.5x-8x faster decompression speed, C/C++
Other
695 stars 71 forks source link

MinGW gcc-4.8.1 errors compiling the code #5

Open biller23 opened 9 years ago

biller23 commented 9 years ago

[ 52%] Built target lzhamdecomp Scanning dependencies of target lzhamcomp [ 57%] Building CXX object lzhamcomp/CMakeFiles/lzhamcomp.dir/lzham_lzbase.cpp.obj [ 61%] Building CXX object lzhamcomp/CMakeFiles/lzhamcomp.dir/lzham_lzcomp.cpp.obj In file included from C:\lzham_codec-master\lzhamcomp\lzham_threading.h:5:0, from C:\lzham_codec-master\lzhamcomp\lzham_match_accel.h:5, from C:\lzham_codec-master\lzhamcomp\lzham_lzcomp_internal.h:4, from C:\lzham_codec-master\lzhamcomp\lzham_lzcomp.cpp:6: C:\lzham_codec-master\lzhamcomp\lzham_win32_threading.h: In constructor 'lzham::tsstack::tsstack(bool)': C:\lzham_codec-master\lzhamcomp\lzham_win32_threading.h:72:43: error: there are no arguments to 'InitializeSListHead' that depend on a template parameter, so a declaration of 'InitializeSListHead' must be available [-fpermissive] InitializeSListHead(&m_stack_head); ^ C:\lzham_codec-master\lzhamcomp\lzham_win32_threading.h:72:43: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated) C:\lzham_codec-master\lzhamcomp\lzham_win32_threading.h:73:46: error: there are no arguments to 'InitializeSListHead' that depend on a template parameter, so a declaration of 'InitializeSListHead' must be available [-fpermissive] InitializeSListHead(&m_freelist_head); ^ C:\lzham_codec-master\lzhamcomp\lzham_win32_threading.h: In member function 'void lzham::tsstack::clear()': C:\lzham_codec-master\lzhamcomp\lzham_win32_threading.h:85:72: error: there are no arguments to 'InterlockedPopEntrySList' that depend on a template parameter, so a declaration of 'InterlockedPopEntrySList' must be available [-fpermissive] node* pNode = (node*)InterlockedPopEntrySList(&m_stack_head); ^ C:\lzham_codec-master\lzhamcomp\lzham_win32_threading.h: In member function 'void lzham::tsstack::flush_freelist()': C:\lzham_codec-master\lzhamcomp\lzham_win32_threading.h:106:75: error: there are no arguments to 'InterlockedPopEntrySList' that depend on a template parameter, so a declaration of 'InterlockedPopEntrySList' must be available [-fpermissive]

         node* pNode = (node*)InterlockedPopEntrySList(&m_freelist_head);
                                                                       ^

C:\lzham_codec-master\lzhamcomp\lzham_win32_threading.h: In member function 'bool lzham::tsstack::pop(T&)': C:\lzham_codec-master\lzhamcomp\lzham_win32_threading.h:133:69: error: there are no arguments to 'InterlockedPopEntrySList' that depend on a template parameter, so a declaration of 'InterlockedPopEntrySList' must be available [-fpermissive]

      node* pNode = (node*)InterlockedPopEntrySList(&m_stack_head);
                                                                 ^

C:\lzham_codec-master\lzhamcomp\lzham_win32_threading.h: In member function 'lzham::tsstack::node* lzham::tsstack::alloc_node()': C:\lzham_codec-master\lzhamcomp\lzham_win32_threading.h:162:89: error: there are no arguments to 'InterlockedPopEntrySList' that depend on a template parameter, so a declaration of 'InterlockedPopEntrySList' must be available [-fpermissive]

      node* pNode = m_use_freelist ? (node*)InterlockedPopEntrySList(&m_freelist_head) : NULL;
                                                                                     ^

In file included from C:\lzham_codec-master\lzhamcomp\lzham_lzcomp.cpp:3:0: C:\lzham_codec-master\lzhamcomp\lzham_match_accel.h: At global scope: C:/lzham_codec-master/lzhamcomp/../lzhamdecomp/lzham_core.h:87:31: error: '__forceinline' does not name a type

define LZHAM_FORCE_INLINE __forceinline

                           ^

C:\lzham_codec-master\lzhamcomp\lzham_match_accel.h:76:7: note: in expansion of macro 'LZHAM_FORCE_INLINE' LZHAM_FORCE_INLINE uint get_match_len(uint lookahead_ofs, int dist, uint max_match_len, uint start_match_len = 0) const ^ C:/lzham_codec-master/lzhamcomp/../lzhamdecomp/lzham_core.h:87:31: error: '__forceinline' does not name a type

define LZHAM_FORCE_INLINE __forceinline

                           ^

C:\lzham_codec-master\lzhamcomp\lzham_lzcomp_internal.h:362:10: note: in expansion of macro 'LZHAM_FORCE_INLINE' LZHAM_FORCE_INLINE void clear() ^ C:/lzham_codec-master/lzhamcomp/../lzhamdecomp/lzham_core.h:87:31: error: '__forceinline' does not name a type

define LZHAM_FORCE_INLINE __forceinline

                           ^

C:\lzham_codec-master\lzhamcomp\lzham_lzcomp_internal.h:387:10: note: in expansion of macro 'LZHAM_FORCE_INLINE' LZHAM_FORCE_INLINE void clear() ^ lzhamcomp\CMakeFiles\lzhamcomp.dir\build.make:78: recipe for target 'lzhamcomp/CMakeFiles/lzhamcomp.dir/lzham_lzcomp.cpp.obj' failed

richgel999 commented 9 years ago

Thanks - after I release v1.1 I'll see if I can clean this up.

FWIW, I've just successfully compiled lzham_codec_devel using tdm-gcc 4.6.1 x64. I used cmake to generate a CodeBlocks project file, after tweaking the lzhamcomp's CMakeLists.txt to use lzham_win32_threading.cpp/.h and got rid of pthread, and I modified lzhamtest to get rid of #define LZHAM_USE_LZHAM_DLL 1.

I used this cmake command line:

cmake . -G "CodeBlocks - MinGW Makefiles" -DCMAKE_C_COMPILER="C:/MinGW64/bin/gcc.exe" -DCMAKE_MAKE_PROGRAM="C:/MinGW64/bin/mingw32-make.exe" -DCMAKE_CXX_COMPILER="C:/MinGW64/bin/g++.exe"