Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MinGW gcc-4.8.1 errors compiling the code #5

Open
biller23 opened this issue Feb 5, 2015 · 1 comment
Open

MinGW gcc-4.8.1 errors compiling the code #5

biller23 opened this issue Feb 5, 2015 · 1 comment

Comments

@biller23
Copy link

biller23 commented Feb 5, 2015

[ 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
Copy link
Owner

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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants