#55 dansguardian-2.10.1.1 fails to compile at GCC 4.4

v2.8
open
nobody
None
5
2015-01-23
2009-07-18
berg.foss
No

some build errors happened at gcc 4.4.0. I was googling and found similar cases with other programs ( http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=526664 )

in my case the error was:
g++ -DHAVE_CONFIG_H -I. -I.. -DCONFFILE='"/usr/local/etc/dansguardian/dansguardian.conf"' -DLOGLOCATION='"/usr/local/var/log/dansguardian/"' -DPIDDIR='"/usr/local/var/run"' -DPROXYUSER='"nobody"' -DPROXYGROUP='"nobody"' -DCONFDIR='"/usr/local/etc/dansguardian"' -g -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -MT dansguardian-fancy.o -MD -MP -MF .deps/dansguardian-fancy.Tpo -c -o dansguardian-fancy.o test -f 'downloadmanagers/fancy.cpp' || echo './'downloadmanagers/fancy.cpp
downloadmanagers/fancy.cpp: In member function ‘std::string fancydm::timestring(int)’:
downloadmanagers/fancy.cpp:507: error: ‘snprintf’ was not declared in this scope
make[2]: [dansguardian-fancy.o] Erro 1
make[2]: Saindo do diretório /home/myloginz/INSTALL/dansguardian-2.10.1.1/src' make[1]: ** [all-recursive] Erro 1 make[1]: Saindo do diretório/home/myloginz/INSTALL/dansguardian-2.10.1.1'
make:
[all] Erro 2
myloginz@ubuntu:~/INSTALL/dansguardian-2.10.1.1$ gcc --version
gcc (Ubuntu 4.4.0-11ubuntu1) 4.4.0
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

myloginz@ubuntu:~/INSTALL/dansguardian-2.10.1.1$ uname -a
Linux ubuntu 2.6.31-1-generic #14-Ubuntu SMP Thu Jul 2 16:03:01 UTC 2009 i686 GNU/Linux

I inserted this include and worked fine

include <cstdio>

I think that bug 2786376 ( http://sourceforge.net/tracker/?func=detail&aid=2786376&group_id=131757&atid=722098 ) has the same root: missing #include <cstdio>

so, i try with other options

./configure --enable-static-zlib --enable-segv-backtrace --enable-orig-ip --enable-orig-ip --enable-clamav --enable-clamd --enable-icap --enable-kavd --enable-commandline --enable-trickledm --enable-ntlm --enable-email

the folow errors happened using make -i:
g++ -DHAVE_CONFIG_H -I. -I.. -DCONFFILE='"/usr/local/etc/dansguardian/dansguardian.conf"' -DLOGLOCATION='"/usr/local/var/log/dansguardian/"' -DPIDDIR='"/usr/local/var/run"' -DPROXYUSER='"nobody"' -DPROXYGROUP='"nobody"' -DCONFDIR='"/usr/local/etc/dansguardian"' -Wall -g -O2 -fno-strict-aliasing -rdynamic -g -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -MT dansguardian-ConnectionHandler.o -MD -MP -MF .deps/dansguardian-ConnectionHandler.Tpo -c -o dansguardian-ConnectionHandler.o test -f 'ConnectionHandler.cpp' || echo './'ConnectionHandler.cpp
In file included from ConnectionHandler.cpp:48:
/usr/include/linux/netfilter_ipv4.h:53: error: ‘INT_MIN’ was not declared in this scope
/usr/include/linux/netfilter_ipv4.h:64: error: ‘INT_MAX’ was not declared in this scope
/usr/include/linux/netfilter_ipv4.h:65: error: ‘INT_MAX’ was not declared in this scope
make[2]: [dansguardian-ConnectionHandler.o] Erro 1 (ignorado)

g++ -DHAVE_CONFIG_H -I. -I.. -DCONFFILE='"/usr/local/etc/dansguardian/dansguardian.conf"' -DLOGLOCATION='"/usr/local/var/log/dansguardian/"' -DPIDDIR='"/usr/local/var/run"' -DPROXYUSER='"nobody"' -DPROXYGROUP='"nobody"' -DCONFDIR='"/usr/local/etc/dansguardian"' -Wall -g -O2 -fno-strict-aliasing -rdynamic -g -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -MT dansguardian-clamav.o -MD -MP -MF .deps/dansguardian-clamav.Tpo -c -o dansguardian-clamav.o test -f 'contentscanners/clamav.cpp' || echo './'contentscanners/clamav.cpp
contentscanners/clamav.cpp:74: error: field ‘limits’ has incomplete type
contentscanners/clamav.cpp: In member function ‘virtual int clamavinstance::quit()’:
contentscanners/clamav.cpp:103: error: ‘cl_free’ was not declared in this scope
contentscanners/clamav.cpp: In member function ‘virtual int clamavinstance::scanMemory(HTTPHeader, HTTPHeader, const char, int, const char, const char, unsigned int)’:
contentscanners/clamav.cpp:131: error: ‘tmpnam’ was not declared in this scope
contentscanners/clamav.cpp:167: error: ‘limits’ was not declared in this scope
contentscanners/clamav.cpp: In member function ‘virtual int clamavinstance::scanFile(HTTPHeader
, HTTPHeader, const char, int, const char, const char)’:
contentscanners/clamav.cpp:192: error: ‘limits’ was not declared in this scope
contentscanners/clamav.cpp: In member function ‘virtual int clamavinstance::init(void)’:
contentscanners/clamav.cpp:249: error: ‘cl_settempdir’ was not declared in this scope
contentscanners/clamav.cpp:259: error: ‘limits’ was not declared in this scope
contentscanners/clamav.cpp:270: error: cannot convert ‘cl_engine
’ to ‘cl_engine’ for argument ‘2’ to ‘int cl_load(const char, cl_engine, unsigned int*, unsigned int)’
contentscanners/clamav.cpp:280: error: ‘cl_build’ was not declared in this scope
make[2]: [dansguardian-clamav.o] Erro 1 (ignorado)
mv -f .deps/dansguardian-clamav.Tpo .deps/dansguardian-clamav.Po

g++ -DHAVE_CONFIG_H -I. -I.. -DCONFFILE='"/usr/local/etc/dansguardian/dansguardian.conf"' -DLOGLOCATION='"/usr/local/var/log/dansguardian/"' -DPIDDIR='"/usr/local/var/run"' -DPROXYUSER='"nobody"' -DPROXYGROUP='"nobody"' -DCONFDIR='"/usr/local/etc/dansguardian"' -Wall -g -O2 -fno-strict-aliasing -rdynamic -g -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -MT dansguardian-icapscan.o -MD -MP -MF .deps/dansguardian-icapscan.Tpo -c -o dansguardian-icapscan.o test -f 'contentscanners/icapscan.cpp' || echo './'contentscanners/icapscan.cpp
contentscanners/icapscan.cpp: In member function ‘virtual int icapinstance::scanMemory(HTTPHeader, HTTPHeader, const char, int, const char, const char, unsigned int)’:
contentscanners/icapscan.cpp:236: error: ‘snprintf’ was not declared in this scope
contentscanners/icapscan.cpp: In member function ‘virtual int icapinstance::scanFile(HTTPHeader
, HTTPHeader, const char, int, const char, const char)’:
contentscanners/icapscan.cpp:350: error: ‘snprintf’ was not declared in this scope
contentscanners/icapscan.cpp: In member function ‘bool icapinstance::doHeaders(Socket&, HTTPHeader, HTTPHeader, unsigned int)’:
contentscanners/icapscan.cpp:446: error: ‘snprintf’ was not declared in this scope
contentscanners/icapscan.cpp:448: error: ‘snprintf’ was not declared in this scope
make[2]: [dansguardian-icapscan.o] Erro 1 (ignorado)
mv -f .deps/dansguardian-icapscan.Tpo .deps/dansguardian-icapscan.Po

g++ -DHAVE_CONFIG_H -I. -I.. -DCONFFILE='"/usr/local/etc/dansguardian/dansguardian.conf"' -DLOGLOCATION='"/usr/local/var/log/dansguardian/"' -DPIDDIR='"/usr/local/var/run"' -DPROXYUSER='"nobody"' -DPROXYGROUP='"nobody"' -DCONFDIR='"/usr/local/etc/dansguardian"' -Wall -g -O2 -fno-strict-aliasing -rdynamic -g -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -MT dansguardian-commandlinescan.o -MD -MP -MF .deps/dansguardian-commandlinescan.Tpo -c -o dansguardian-commandlinescan.o test -f 'contentscanners/commandlinescan.cpp' || echo './'contentscanners/commandlinescan.cpp
contentscanners/commandlinescan.cpp: In member function ‘virtual int commandlineinstance::scanFile(HTTPHeader, HTTPHeader, const char, int, const char, const char*)’:
contentscanners/commandlinescan.cpp:293: error: ‘fdopen’ was not declared in this scope
contentscanners/commandlinescan.cpp:294: error: ‘fgets’ was not declared in this scope
contentscanners/commandlinescan.cpp:300: error: ‘fclose’ was not declared in this scope
contentscanners/commandlinescan.cpp:302: error: ‘fgets’ was not declared in this scope
make[2]: [dansguardian-commandlinescan.o] Erro 1 (ignorado)
mv -f .deps/dansguardian-commandlinescan.Tpo .deps/dansguardian-commandlinescan.Po

there is some warning too

make[2]: Entrando no diretório /home/myloginz/INSTALL/dansguardian-2.10.1.1/src' g++ -DHAVE_CONFIG_H -I. -I.. -D__CONFFILE='"/usr/local/etc/dansguardian/dansguardian.conf"' -D__LOGLOCATION='"/usr/local/var/log/dansguardian/"' -D__PIDDIR='"/usr/local/var/run"' -D__PROXYUSER='"nobody"' -D__PROXYGROUP='"nobody"' -D__CONFDIR='"/usr/local/etc/dansguardian"' -Wall -g -O2 -fno-strict-aliasing -rdynamic -g -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -MT dansguardian-String.o -MD -MP -MF .deps/dansguardian-String.Tpo -c -o dansguardian-String.otest -f 'String.cpp' || echo './'`String.cpp
String.cpp: In member function ‘off_t String::toOffset()’:
String.cpp:167: warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘off_t

g++ -DHAVE_CONFIG_H -I. -I.. -DCONFFILE='"/usr/local/etc/dansguardian/dansguardian.conf"' -DLOGLOCATION='"/usr/local/var/log/dansguardian/"' -DPIDDIR='"/usr/local/var/run"' -DPROXYUSER='"nobody"' -DPROXYGROUP='"nobody"' -DCONFDIR='"/usr/local/etc/dansguardian"' -Wall -g -O2 -fno-strict-aliasing -rdynamic -g -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -MT dansguardian-FatController.o -MD -MP -MF .deps/dansguardian-FatController.Tpo -c -o dansguardian-FatController.o test -f 'FatController.cpp' || echo './'FatController.cpp
FatController.cpp: In function ‘bool daemonise()’:
FatController.cpp:309: warning: ignoring return value of ‘int chdir(const char)’, declared with attribute warn_unused_result
FatController.cpp: In function ‘int ip_list_listener(std::string, bool)’:
FatController.cpp:1588: warning: ignoring return value of ‘ssize_t write(int, const void
, size_t)’, declared with attribute warn_unused_result
mv -f .deps/dansguardian-FatController.Tpo .deps/dansguardian-FatController.Po

g++ -DHAVE_CONFIG_H -I. -I.. -DCONFFILE='"/usr/local/etc/dansguardian/dansguardian.conf"' -DLOGLOCATION='"/usr/local/var/log/dansguardian/"' -DPIDDIR='"/usr/local/var/run"' -DPROXYUSER='"nobody"' -DPROXYGROUP='"nobody"' -DCONFDIR='"/usr/local/etc/dansguardian"' -Wall -g -O2 -fno-strict-aliasing -rdynamic -g -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -MT dansguardian-ListContainer.o -MD -MP -MF .deps/dansguardian-ListContainer.Tpo -c -o dansguardian-ListContainer.o test -f 'ListContainer.cpp' || echo './'ListContainer.cpp
ListContainer.cpp: In member function ‘String ListContainer::getListCategoryAt(int, int)’:
ListContainer.cpp:1837: warning: comparison between signed and unsigned integer expressions
ListContainer.cpp: In member function ‘String ListContainer::getListCategoryAtD(int)’:
ListContainer.cpp:1851: warning: comparison between signed and unsigned integer expressions
ListContainer.cpp: In member function ‘void ListContainer::graphSearch(std::map<std::basic_string<char, std::char_traits<char="">, std::allocator<char> >, std::pair<unsigned int,="" int="">, std::less<std::basic_string<char, std::char_traits<char="">, std::allocator<char> > >, std::allocator<std::pair<const std::basic_string<char,="" std::char_traits<char="">, std::allocator<char> >, std::pair<unsigned int,="" int=""> > > >&, char
, off_t)’:
ListContainer.cpp:1165: warning: ‘currnode’ may be used uninitialized in this function
mv -f .deps/dansguardian-ListContainer.Tpo .deps/dansguardian-ListContainer.Po

g++ -DHAVE_CONFIG_H -I. -I.. -DCONFFILE='"/usr/local/etc/dansguardian/dansguardian.conf"' -DLOGLOCATION='"/usr/local/var/log/dansguardian/"' -DPIDDIR='"/usr/local/var/run"' -DPROXYUSER='"nobody"' -DPROXYGROUP='"nobody"' -DCONFDIR='"/usr/local/etc/dansguardian"' -Wall -g -O2 -fno-strict-aliasing -rdynamic -g -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -MT dansguardian-trickle.o -MD -MP -MF .deps/dansguardian-trickle.Tpo -c -o dansguardian-trickle.o test -f 'downloadmanagers/trickle.cpp' || echo './'downloadmanagers/trickle.cpp
downloadmanagers/trickle.cpp: In member function ‘virtual int trickledm::in(DataBuffer, Socket, Socket, HTTPHeader, HTTPHeader, bool, int, bool)’:
downloadmanagers/trickle.cpp:177: warning: ignoring return value of ‘ssize_t read(int, void
, size_t)’, declared with attribute warn_unused_result
mv -f .deps/dansguardian-trickle.Tpo .deps/dansguardian-trickle.Po

Discussion

  • Mathieu PARENT

    Mathieu PARENT - 2011-09-02

    This seems to be partially solved from rev 1062.

    but I still need the followinf patch:

    Index: src/contentscanners/commandlinescan.cpp

    --- src/contentscanners/commandlinescan.cpp (révision 1138)
    +++ src/contentscanners/commandlinescan.cpp (copie de travail)
    @@ -24,6 +24,7 @@
    #include <sys wait.h="">
    #include <unistd.h>
    #include <list>
    +#include <cstdio>

    // GLOBALS

     
  • Aecio F. Neto

    Aecio F. Neto - 2012-10-10
    • milestone: --> v2.8
     
  • Aecio F. Neto

    Aecio F. Neto - 2012-10-10

    Solved in version 2.12 and above
    Check Changelog file, please

     
  • Patrick Welche

    Patrick Welche - 2014-03-25

    Just tried to compile dansguardian-2.12.0.3 with gcc 4.8.3, and

    ~~~~
    --- dansguardian-UDSocket.o ---
    UDSocket.cpp: In constructor 'UDSocket::UDSocket()':
    UDSocket.cpp:41:34: error: 'memset' was not declared in this scope
    memset(&my_adr, 0, sizeof my_adr);
    ^
    UDSocket.cpp:44:28: error: 'strcpy' was not declared in this scope
    strcpy(my_adr.sun_path, "");
    ^
    ~~~
    etc

     
  • Patrick Welche

    Patrick Welche - 2014-03-25

    The attached patch adds the missing <cstring> includes.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks