wootguy / Glitch-Life

Randomizes Sven Co-op maps
http://forums.svencoop.com/showthread.php/42021-Glitch-Life-program
36 stars 8 forks source link

Building fails on Linux #4

Closed incognico closed 8 years ago

incognico commented 8 years ago
srcds@heusenstamm:~/sc5/svencoop_addon/glsrc/Glitch-Life/build$ make
[ 10%] Building CXX object CMakeFiles/gsrand.dir/src/bsp_util.cpp.o
In file included from /home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.h:13:0,
                 from /home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/bsp_util.cpp:3:
/home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/modelList.h: In function ‘void parse_model_lists()’:
/home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/modelList.h:66:17: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
    if (comments != string::npos)
                 ^
/home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/modelList.h:76:21: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
    if (begin_header != string::npos)
                     ^
/home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/modelList.h:79:20: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     if (end_header != string::npos)
                    ^
/home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/modelList.h:91:21: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
       if (ampersand != string::npos)
                     ^
/home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/bsp_util.cpp: In function ‘void corrupt_map_textures(BSP*, Entity**)’:
/home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/bsp_util.cpp:747:35: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
    if (offset + sizeof(BSPMIPTEX) > lump_len)
                                   ^
/home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/bsp_util.cpp:768:63: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
    if (t->nOffsets[0] == 0 || t->nOffsets[0] + offset + szAll > lump_len)
                                                               ^
cc1plus: all warnings being treated as errors
CMakeFiles/gsrand.dir/build.make:54: recipe for target 'CMakeFiles/gsrand.dir/src/bsp_util.cpp.o' failed
make[2]: *** [CMakeFiles/gsrand.dir/src/bsp_util.cpp.o] Error 1
CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/gsrand.dir/all' failed
make[1]: *** [CMakeFiles/gsrand.dir/all] Error 2
Makefile:76: recipe for target 'all' failed
make: *** [all] Error 2

CC @Yoplitein

Am I missing something or does the code need an update?

Yoplitein commented 8 years ago

Huh. Not sure why I didn't get these warnings when I was working on the port. Anyway, adding -Wno-sign-compare to CMAKE_CXX_FLAGS should suppress those errors.

incognico commented 8 years ago

Ok thx, but now gsrand.cpp is causing somre more troble:

[ 40%] Building CXX object CMakeFiles/gsrand.dir/src/gsrand.cpp.o
/home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.cpp: In function ‘void filter_default_content(std::vector<std::basic_string<char
> >&, const char**, int, std::vector<std::basic_string<char> >&, std::string, int&, int&, std::string&)’:
/home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.cpp:384:59: error: suggest parentheses around ‘&&’ within ‘||’ [-Werror=parentheses]
  if (contentMode != CONTENT_EVERYTHING || maxContentBytes && search_paths.size() || skipUppercase)
                                                           ^
/home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.cpp:397:11: error: ‘Sleep’ was not declared in this scope
    Sleep(5);
           ^
/home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.cpp:417:11: error: use of deleted function function ‘std::basic_ifstream<char>& std::basic_ifstream<char>::operator=(const std::basic_ifstream<char>&)’
       fin = ifstream(search_paths[k] + unfiltered[i] + ext, ios::binary);
           ^
In file included from /home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.h:6:0,
                 from /home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.cpp:3:
/usr/include/c++/4.9/fstream:430:11: note: ‘std::basic_ifstream<char>& std::basic_ifstream<char>::operator=(const std::basic_ifstream<char>&)’ is implicitly deleted because the default definition would be ill-formed:
     class basic_ifstream : public basic_istream<_CharT, _Traits>
           ^
/usr/include/c++/4.9/fstream:430:11: error: use of deleted function ‘std::basic_istream<char>& std::basic_istream<char>::operator=(const std
::basic_istream<char>&)’
In file included from /usr/include/c++/4.9/iostream:40:0,
                 from /home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.h:5,
                 from /home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.cpp:3:
/usr/include/c++/4.9/istream:58:11: note: ‘std::basic_istream<char>& std::basic_istream<char>::operator=(const std::basic_istream<char>&)’ is implicitly deleted because the default definition would be ill-formed:
     class basic_istream : virtual public basic_ios<_CharT, _Traits>
           ^
/usr/include/c++/4.9/istream:58:11: error: use of deleted function ‘std::basic_ios<char>& std::basic_ios<char>::operator=(const std::basic_i
os<char>&)’
In file included from /usr/include/c++/4.9/ios:44:0,
                 from /usr/include/c++/4.9/ostream:38,
                 from /usr/include/c++/4.9/iostream:39,
                 from /home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.h:5,
                 from /home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.cpp:3:
/usr/include/c++/4.9/bits/basic_ios.h:66:11: note: ‘std::basic_ios<char>& std::basic_ios<char>::operator=(const std::basic_ios<char>&)’ is i
mplicitly deleted because the default definition would be ill-formed:
     class basic_ios : public ios_base
           ^
In file included from /usr/include/c++/4.9/ios:42:0,
                 from /usr/include/c++/4.9/ostream:38,
                 from /usr/include/c++/4.9/iostream:39,
                 from /home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.h:5,
                 from /home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.cpp:3:
/usr/include/c++/4.9/bits/ios_base.h:789:5: error: ‘std::ios_base& std::ios_base::operator=(const std::ios_base&)’ is private
     operator=(const ios_base&);
     ^
In file included from /usr/include/c++/4.9/ios:44:0,
                 from /usr/include/c++/4.9/ostream:38,
                 from /usr/include/c++/4.9/iostream:39,
                 from /home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.h:5,
                 from /home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.cpp:3:
/usr/include/c++/4.9/bits/basic_ios.h:66:11: error: within this context
     class basic_ios : public ios_base
           ^
In file included from /home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.h:6:0,
                 from /home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.cpp:3:
/usr/include/c++/4.9/fstream:430:11: error: use of deleted function ‘std::basic_filebuf<char>& std::basic_filebuf<char>::operator=(const std
::basic_filebuf<char>&)’
     class basic_ifstream : public basic_istream<_CharT, _Traits>
           ^
/usr/include/c++/4.9/fstream:72:11: note: ‘std::basic_filebuf<char>& std::basic_filebuf<char>::operator=(const std::basic_filebuf<char>&)’ i
s implicitly deleted because the default definition would be ill-formed:
     class basic_filebuf : public basic_streambuf<_CharT, _Traits>
           ^
In file included from /usr/include/c++/4.9/ios:43:0,
                 from /usr/include/c++/4.9/ostream:38,
                 from /usr/include/c++/4.9/iostream:39,
                 from /home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.h:5,
                 from /home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.cpp:3:
/usr/include/c++/4.9/streambuf:810:7: error: ‘std::basic_streambuf<_CharT, _Traits>& std::basic_streambuf<_CharT, _Traits>::operator=(const 
std::basic_streambuf<_CharT, _Traits>&) [with _CharT = char; _Traits = std::char_traits<char>]’ is private
       operator=(const basic_streambuf&) { return *this; };
       ^
In file included from /home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.h:6:0,
                 from /home/srcds/sc5/svencoop_addon/glsrc/Glitch-Life/src/gsrand.cpp:3:
/usr/include/c++/4.9/fstream:72:11: error: within this context
     class basic_filebuf : public basic_streambuf<_CharT, _Traits>
           ^
cc1plus: all warnings being treated as errors
CMakeFiles/gsrand.dir/build.make:123: recipe for target 'CMakeFiles/gsrand.dir/src/gsrand.cpp.o' failed
make[2]: *** [CMakeFiles/gsrand.dir/src/gsrand.cpp.o] Error 1
CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/gsrand.dir/all' failed
make[1]: *** [CMakeFiles/gsrand.dir/all] Error 2
Makefile:76: recipe for target 'all' failed
make: *** [all] Error 2

Sleep() seems to be a Windows only function. Also tested -Wno-parentheses but the other stuff about the deleted function stuff prevents it from compiling.

Yoplitein commented 8 years ago

I'm currently working on getting everything compiling again under posix.

Yoplitein commented 8 years ago

Apply #5 locally, should do the trick.

incognico commented 8 years ago

5 works, thanks.